I've used JavaScript to initialise a grid. Please have a look at this JSBin which illustrates what I have at the moment. The grid has been built based on this example in the Code Library, which allows grid rows to be selected using checkboxes.
I'm looking for a way to pass selected row IDs from one grid to another almost identical grid in a separate MVC view. Each time the desired rows have been selected followed by pressing the 'Show selected IDs' button, the IDs of the selected rows are to be sent to another view containing a grid of Products with a few additional columns. How can I send those IDs back to a controller and display the corresponding rows in the second grid?
For the second part of my question, I want to have a field called ViewCount that keeps count of the number of times a row has been selected. Based on the previously mentioned action of selecting rows and clicking a button, I want to then increase the ViewCount by 1. Is it possible and how can I go about doing that?
My thinking is that both events could be bound to the following function:
Any help would be much appreciated. Thanks!
I'm looking for a way to pass selected row IDs from one grid to another almost identical grid in a separate MVC view. Each time the desired rows have been selected followed by pressing the 'Show selected IDs' button, the IDs of the selected rows are to be sent to another view containing a grid of Products with a few additional columns. How can I send those IDs back to a controller and display the corresponding rows in the second grid?
For the second part of my question, I want to have a field called ViewCount that keeps count of the number of times a row has been selected. Based on the previously mentioned action of selecting rows and clicking a button, I want to then increase the ViewCount by 1. Is it possible and how can I go about doing that?
My thinking is that both events could be bound to the following function:
$(
"#showSelection"
).bind(
"click"
,
function
() {
var
checked = [];
for
(
var
i
in
checkedIds){
if
(checkedIds[i]){
checked.push(i);
}
}
//Code goes here
});
});