Search Box

Search Box

sekharsekhar Posts: 5Questions: 0Answers: 0
edited July 2011 in General
Hello,
I'm new to jQuery and Data tables.

I have two issues here.

1. On load of the table I would like to filter the content by passing default value to the search box.(I load a popup which holds the table, the popup will be displayed on click of a button. So I would like to set the default search text on click of the button)

2. I have a table with check box on each row. On select of the check box a text box will be visible and I can enter value in it. On Unselect the text box will disappear. Up to here it is fine. But the problem is, through data tables pagination, when I select records across different pages I'm able to retrieve the row Id's that are selected across all the pages. But the text box value inside the column of that row is coming as undefined. Please help me in this. Hope I'm clear on this.

Thanks

Replies

  • sekharsekhar Posts: 5Questions: 0Answers: 0
    Okay..I have used fnFilter and I resolved the first issue.

    Please help me how to solve the second one.
  • sekharsekhar Posts: 5Questions: 0Answers: 0
    Can you tel me how to make the searchbox readonly
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    You could set the 'disabled' attribute of the input field: http://stackoverflow.com/questions/1414365/how-to-disable-an-input-with-jquery

    Allan
  • sekharsekhar Posts: 5Questions: 0Answers: 0
    Thanks Allan for your reply.

    Can you please guide me on my second issue I posted earlier. Retrieving selected data across all pages while using datatable.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    [quote]sekhar said: text box value inside the column of that row is coming as undefined[/quote]

    How are you trying to read the text field? You need to use fnGetNodes() to get all TR elements in the table regardless of paging. From there you can use standard jQuery / DOM methods.

    Allan
  • sekharsekhar Posts: 5Questions: 0Answers: 0
    edited July 2011
    Hello Allan,
    I'm using fnGetNodes() to get all TR elements. And, I'm able access all the TR which are in different page. But, the textbox value that is in different pagination page is coming as undefined. Only the current pagination page textbox vales are accessible.

    Help me.
This discussion has been closed.