Buttons Text chnages when i call fnFilter

Buttons Text chnages when i call fnFilter

newbee06newbee06 Posts: 17Questions: 0Answers: 0
edited February 2012 in General
Hi,

I have a table and i have added buttons
[code]$("").prependTo($('.dataTables_filter'));[/code]

and at certain point i apply filter on the table like this
[code]viewATPDataTable.fnFilter("ABC");[/code]

When this filter is applied, My button text(label) changes to "ABC" from delete.

Any help is appreciated.

Replies

  • newbee06newbee06 Posts: 17Questions: 0Answers: 0
    This got solved.. I simply did
    [code]viewATPDataTable.fnFilter("ABC");
    $('#deleteAgileProgButton').val("Delete");[/code]

    But is this the correct way.
    Any other better suggestions?
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Hi,

    This was a bit of a bug in DataTables - the way I was updating the text input with your filtering string was with the selector $('input', ctx) - hence it matched your additional button as well. I've just committed a change which makes the selector DataTables uses more selective and will only update the correct element. This will be included in 1.9.1 and is available now as the 1.9.1.dev nightly on the download page.

    Allan
  • newbee06newbee06 Posts: 17Questions: 0Answers: 0
    Thanks Allan.

    I tried using the nightly script.
    http://datatables.net/download/build/jquery.dataTables.nightly.js

    But tht didnt seem to work
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Did you grab it after my commit this morning (i.e. just after my post earlier) and clear your browser cache just to make sure? Here is an example using the nightly that shows that it should work now: http://live.datatables.net/ideqox/edit

    Allan
  • newbee06newbee06 Posts: 17Questions: 0Answers: 0
    Thanks Allan,

    I guess i took the changes before you committed it
    It did work now.
This discussion has been closed.