php - build sortable table from multiple ajax request PART II -
i have question here.
i have php script request data other web service.
but need request many data need queue them , wait 1 one.
so request data using jquery (async), problem is, data sorted loaded sequence.
so how request them async, sorted them price(for example column 6) , serve them table..
thank answer , suggestion..
so here's code.
this table container
<table id="searchh" width="100%" border="0" cellpadding="10px" cellspacing="1px"> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> </tr> </table>
i request new tr
via this
$.get(request, function( my_var1 ) { $('#searchh>tbody>tr:last').after(my_var1); });
content of request
this
<tr> <td>data</td> <td>data</td> <td>data</td> <td>data</td> <td>data</td> <td>random number</td> </tr>
here answer question,
in ajax after fetching data server,trigger click on price
, this,
$.get(request, function( my_var1 ) { $('#searchh>tbody>tr:last').after(my_var1); $("th#price").trigger( "click" ); });
dont forget give id th has price, , trigger should called after fetch records
rest can found in working demo here.
hope helps you.
resource here
Comments
Post a Comment