Savestate column input fields value

Savestate column input fields value

wizzboywizzboy Posts: 5Questions: 0Answers: 0
edited April 2009 in General
Hi

I'm using Version: 1.5.0 beta 6.
I'm having the following problem.

I'm using bStateSave en also use individual column filter.

The first time when i use the filter all the values of the inputfields are correct.
But when i come back to the page the inputfields values for the filtered columns aren't correct anymore!
They give the original value ex. "Search engines"

Can you help me with this?

Many thanks

Replies

  • allanallan Posts: 63,230Questions: 1Answers: 10,417 Site admin
    Hi wizzboy,

    The thing with the individual column filters is that DataTables itself doesn't know where that information is coming from - in this case of course it is coming from the input boxes, but it could be a select menu or anything else. This is because it's an API only features.

    So what to do in order to achieve what you are looking for is that once the DataTable has initialised, you need to grab the settings object from the table ( fnSettings() ) and parse through the array aoPreSearchCols (the sSearch parameter of each object in that array is what you are interested in) and fill in the input select boxes with the previous search information.

    Hope this helps!
    Allan
  • wizzboywizzboy Posts: 5Questions: 0Answers: 0
    Thank you for your help.

    I'm only have 1 problem how can i put it in the inputfields. I have the following code

    /* Now do the individual input values */
    for ( var i=0 ; i
  • allanallan Posts: 63,230Questions: 1Answers: 10,417 Site admin
    Yup - this is what you need to do. You've defined the input fields, so you can define what you need exactly. For example, if you have exactly the same number of input fields as columns you might do something like:

    [code]
    /* Now do the individual input values */
    var jqInputs = $('input XXX-whatever-selector');
    for ( var i=0 ; i
  • wizzboywizzboy Posts: 5Questions: 0Answers: 0
    Thank you very much

    I have used the following code:

    /* Now do the individual input values */
    var jqInputs = $('thead input');
    for ( var i=0 ; i
This discussion has been closed.