jquery uniform not styling ajax load elements

1.6k views Asked by At

I am using jquery to load a remote page into a page. The remote page contains some selects and inputs that are no longer styled due to the ajax load. From what I could find I need to specify those again and update, but the below is not working.

// load the page into div
$('#show_comps').load('/process/show_comps.php');

// correct the uniform styling
$.uniform('select, input');
$.uniform.update();

EDIT :

$('#show_comps').load('/process/show_comps.php',
    function() {
        $('#show_comps').find('select').uniform(),
        $('#show_comps').find('input:checkbox').uniform()
    }
)

This corrected the checkboxes on the page, but the drop down is still not working (it changed style-wise, but not correct).

<select class="form-control input-medium select2me pull-right" onChange="App.scrollTo($(this.value), -60)" data-placeholder="Jump to computer...">
    <option value=""></option>
    ...and so on

2nd EDIT :

The drop down was using select2 plugin. This is what I ended up with which works as expected.

$('#show_comps').load('/process/show_comps.php',
    function() {
        $('#show_comps').find('input').uniform();
        $('#comp_selection select').select2();
    }
)
1

There are 1 answers

0
Jaskaran singh Rajal On

after ajax call when after data came use this

$('.elementClass').uniform();