How to clear the data while navigating through pages in jquery?


On page1 if 2 rows selected, i will get id1, id2

If page2 selected id1 and id2 should be cleared, only page2 selected rows should be there. 

How should i achieve this using jquery?


Asked by:- SnehalSawant
0
: 1962 At:- 3/30/2018 10:05:30 AM
jQuery ASP.NET

what is your question, no body will be able to understand it, please elaborate more, we don't know what situtation you are facing or on what module you are working and your desired output is, please mention all the details so any user can understand it and provide relevant answer 0
By : vikas_jk - at :- 3/30/2018 11:00:28 AM
Please provide more details 0
By : jon - at :- 4/2/2018 9:30:56 AM






1 Answers
profileImage Answered by:- Sam

If I understand your question clearly you have selected two rows from the table and you are showing some data related to that data in a <div> or subpages now you want to clear that data when navigated to the new page.

If I have understood it correctly, you can uncheck selected rows using the checkbox in jQuery like

$('.SelectedCheckboxes').prop('checked', false); // uncheck all selected rows which has class SelectedCheckboxes

Now when you get second-page data using jQuery inject in <div>, selected specific row data using

$('.SelectedCheckboxes',"#div2").prop('checked', true); // Checks it
//here div2 is id of HTML <div> where new page data is inserted

OR if you can get New Id's of rows using jQuery Ajax 

$('#Id1NewPage',"#div2").prop('checked', true);

$('#Id2NewPage',"#div2").prop('checked', true);

Considering, you are creating a table with a checkbox as first row in table

<tr>
<td><input type="checkbox" id="#Id1NewPage" /></td>
<td>.....
....</td>
</tr>


<tr>
<td><input type="checkbox" id="#Id2NewPage" /></td>
<td>.....
....</td>
</tr>

Hope it helps, thanks

1
At:- 4/1/2018 4:28:42 PM






Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use