English 中文(简体)
jQuery quicksearch plug-in tinkering with JSON
原标题:

I ve implemented the quicksearch plugin by Rik Lomas and I love it for an application in a custom CMS I m building. I was wondering though, since I m going to have a bizillion items in the table if there s a way to use the data from my json callback to populate the table as a user searches rather than the table contents themselves.

So when you load the page the chain of events would go something like this:

-jQuery.getJSON request -Initiate quicksearch and limit the number of rows initially presented in the table -As the user makes keystrokes in the filter, the new values are pulled from the JSON data rather than the table contents (still limiting the number displayed in the table) and the table is updated.

My JSON request:

$.getJSON("jsonrequest.php", function(data){

    $.each(data, function(i){
        $("#result tbody").append( <tr><td>  + this.organization +  </td><td>  + this.city +  </td><td>  + this.state +  </td></tr> );
    });

});

My quicksearch function:

$( table#result tbody tr ).quicksearch({
    position:  before ,
    attached:  table#result ,
    stripeRowClass: [ evenrows ,   ],
    labelText:  Filter Results:  ,
    loaderText:   ,
    delay:0,
    focusOnLoad:true
});
最佳回答

If this helps anyone I ve implemented the jQuery plugin DataTables to solve this one, which offers grid functions, pagination and a live filter. It seems to be the most versatile grid plugin I ve come across for my needs.

问题回答

暂无回答




相关问题
JQuery/MVC Search Issue

I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...

jQuery quicksearch plug-in tinkering with JSON

I ve implemented the quicksearch plugin by Rik Lomas and I love it for an application in a custom CMS I m building. I was wondering though, since I m going to have a bizillion items in the table if ...

JSON with classes?

Is there a standardized way to store classes in JSON, and then converting them back into classes again from a string? For example, I might have an array of objects of type Questions. I d like to ...

PHP json_decode question

i m trying to use json_decode to combine a few json objects and then re-encode it. my json looks like: { "core": { "segment": [ { "id": 7, "...

Converting JSON data to Java object

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson(). Below is an example of what the string ...

热门标签