kendo ui - How to Post Data from a KendoUI listview Checkbox list -


i'm using below modal popup window display , bind checkbox list.

                  <div id="exportwindow">     <div id="main">         <div id="listview" style="height: 325px; overflow:auto;"></div>         <script type="text/x-kendo-template" id="template">             <div style="padding-left:5px" >                 <span><input type="checkbox"   data-bind="checked: selectedcolumn" #= ischecked ? checked='checked':''# />  #= columnname #</span>             </div>         </script>         <br />     </div> 

i'm using above list view checkbox template , below code bind listview datasource

        $("#showexportlistdialog").kendobutton({         click: function () {              var dtdatasource = new kendo.data.datasource({                 transport: {                     read: {                         url: "@url.action("getexportcolumnlist")",                         data: {                             vendorid: $('#supplierlist option:selected').val().trim(),                             exporttype: "lastimport"                         }                     },                     schema: {                         model: {                             columnname: 'columnname',                             ischecked: 'ischecked',                             exporthanldeid: 'exporthanldeid'                         }                     },                     selectedcolumn: {                         exportcolum: []                     }                 }             });              $("#listview").kendolistview({                 datasource: dtdatasource,                 template: kendo.template($("#template").html())             }); 

exportcolumnlist api returns json response has exportcolumn list.below export column model.

public class exportcolumn  {     public string columnname { get; set; }     public bool ischecked { get; set; }      public exportcolumnhandle exporthanldeid { get; set; } } 

i wanted post data selected checkboxes api. $("#exportproductdata").click(function () {

        var listview = $("#listview").data("kendolistview");          $.ajax({             url: "@url.action("exportproductdata")",             type: "post",             datatype: "json",             contenttype: "application/json",             data: json.stringify({                           exportcolumnlist: listview             })         })     }); 

my api postmethod this.

   public actionresult exportproductdata(list<exportcolumn> exportcolumnlist)    {    } 

i wanted post exportcolumnlist data of selected checkboxes api. how working.

thank you!


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -