i have html select input shows book titles loaded database on page load. default, want show book if it's publish date within last 6 months. additionally,however, user can select checkbox show book titles regardless of publish date , im confused on best way this. getting database information making ajax call handler method on page load. handler method returns title of book publish date in xml format. use jquery find each book , append option select statement. appreciated.
here jquery statement using append database info option select input.
if (status == "success" || status == "notmodified") { var strxml = $(response.responsexml); strxml.find('book').each(function () { var value = $(this).attr('name'); var optionname = $(this).attr('name'); $('#ddlbooklist').append('<option value="' + value + '">' + optionname + '</option>'); });
you using ajax there no need sort data on client if time happen client machine not can handle these kind of operation on page lead browser overload or stop responding. should use ajax request server execute sql since server high end machine can handle request in response return desired data.
but make sure not many sorting should done on server side small can done on client machine sorting or hiding. when there many data display result limited should use ajax, when data requested in sorted manner sorting data present on client not large data can sorted on client side
Comments
Post a Comment