Rows not showing up in DataTable -
i have datatable in view this:
<table id="tblproviders" style="font-size:x-small;width:100%; border: 1px solid black;"> <caption>assigned providers</caption> <thead> <tr> <th>id</th> <th>name</th> <th>email</th> <th>phone</th> <th>role</th> <th>remove</th> </tr> </thead> </table>
and assignment of data:
$("#tblproviders").datatable({ bprocessing: true, sajaxsource: '@url.action("getprovidersbyid")?id=' + $("#txtid").val(), bjqueryui: true, sprocessing: "<img src='~/images/spinner.gif' />", dom: 't<"clear">rtip', "pagelength": 5, bautowidth: false, "olanguage": { semptytable: "there no providers @ time", szerorecords: "there no providers @ time" }, "aocolumns": [ { "swidth": "1%", sclass: "smallfonts" }, { "swidth": "15%", sclass: "smallfonts" }, { "swidth": "15%", sclass: "smallfonts" }, { "swidth": "15%", sclass: "smallfonts" }, { "swidth": "15%", sclass: "smallfonts" }, { "swidth": "15%", sclass: "centerbutton", "sname": "userid", "mrender": function (data, type, row) { return "<button type='button' class='displaybutton' id='" + row[0] + "' onclick=removeprovider(this);return false; >remove</button>"; } } ], tabletools: { "sswfpath": "../../scripts/swf/copy_csv_xls_pdf.swf", "abuttons": [ ] } }); $("#tblproviders").datatable().fnsetcolumnvis(0, false); otab = $("#tblproviders").datatable(); otab.fnsort([[1, 'asc']]);
i know getting correct json data this:
[httpget] public actionresult getprovidersid(string id) { return json(new { aadata = repository.getprovidersbyid(id).select(x => new string[] { x.id.tostring(), x.firstname + " " + x.lastname, x.email, x.phone, x.role, }) }, jsonrequestbehavior.allowget); }
but yet none of rows shows up. doing wrong here? in fact, if debug on loading of table putting debug point @ remove spot, see data never displays.
unfortunately, problem caused use of alphabet search loaded main view. once filtering started , partial view displayed, filtering continued in partial view, showing no results. have question regarding problem no answer yet.
Comments
Post a Comment