jquery - MVC3 getting values from edited rows in datatable -
I am using MVC3 to create a web application. In my web application, I have a dataset displayed object value with a checkbox in each row that the user can check / uncheck. What I would like to do to fix a setup, so that the user can check / uncheck many boxes without having to do anything. Then when the user is done, he presses the "made" button next to the table. Now this happens when I want to do magic. I want to see all the rows to be assembled in an array so that I can send the entire table in the controlling method. I have found in the DataAtable API that I can use the code
var table = $ .fn.dataTable.fnTables (true); If (table.length & gt; 0) {$ (table) .dataTable () FnAdjustColumnSizing (); } so that all data can be saved in one variable. How can I use it now?
In addition to this, I want all this when the user presses my Ajax. The ActionLink, which is currently returning only one more view. Is it possible that my action link sets a variables of the JavaScript variable's return variable, which gives an array of dataset rows?
I will try to show what I am trying to say if I am a bit unclear (I'm not the best web developer at present, please be gentle with me :)) Please comment in code See.
@ Ajax.ActionLink ("Done", "_DoneView", new {value1 = Model.Item1.value1, value2 = Model.Item1.value2, value3 = Model.Item1.value3, / Is it possible to say something like DatatableArray = javascriptFunction () // Javascript function / / which returns an array containing all the rows from the table}, new application {HttpMethod = "GET", UpdateTargetId = "DataTable", InsertionMode = InsertionMode . Replace}, New {@class = "linkButton blue" Thanks for all help and if something is absent / do not hesitate to ask for more information. < / Div>
This is your new link Create a good button with
div = "divId" & gt; div & lt; / div & gt; make a controller which provides a Jason result is something like:
public JsonResult GetAllReservations () {var jsonlist = listOfYourReservations; to Jason (Jesnlist, Jesnyuefestbihwayrkalovet);} < / Pre> After this you can do so in your jQuery:
$ ("# divId"). On ( "click", function () {$ .post ( '/ ControllerName / GetAllReservations', function (data) {$ .each (data, function () {});})}}
Comments
Post a Comment