Search
43659 results 7291-7300
Forum
- 24th Feb 2014Dynamically Add new column for Edit rows in data table asp.net c# 4.5Hello, I am newer in jquery datatable. I have bind a datatable using jqyery datatable. Now i want edit link on each row, I have used below code [code] Actions Name IsActive CreatedOn [/code] [code] $(document).ready(function () { var grid = $('#grid').dataTable({ "bProcessing": true, "sPaginationType": "full_numbers", "bServerSide": true, "sAjaxSource": "../AdminServices.asmx/GetCategories", "fnServerData": function (sSource, aoData, fnCallback) { var jsonAOData = JSON.stringify(aoData); $.ajax({ //dataType: 'json', contentType: "application/json; charset=utf-8", type: "POST", url: sSource, data: "{jsonAOData : '" + jsonAOData + "'}", success: function (msg) { fnCallback(JSON.parse(msg.d)); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert(XMLHttpRequest.status); alert(XMLHttpRequest.responseText); } } ); }, "aoColumnDefs": [ { "fnRender": function (oObj) { return "Edit"; }, "bSortable": false, "aTargets": [0] }, { "sName": "Name", "bSearchable": true, "aTargets": [1] }, { "sName": "IsActive", "bSearchable": true, "bSortable": true, "aTargets": [2] }, { "sName": "CreatedOn", "bSearchable": true, "bSortable": true, "aTargets": [3] } ] }); grid.fnSetFilteringDelay(1000); }); [/code] [code] [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string GetCategories(string jsonAOData) { Enforce.That(string.IsNullOrEmpty(jsonAOData) == false, "GetaData.GetTenants - jsonAOData can not be null"); CategoriesBL categoryBL = new CategoriesBL(); var jsonSerialiser = new JavaScriptSerializer(); var json = categoryBL.GetAllCategory().AsQueryable(); //var tenantRepository = new ; //var tenants = tenantRepository.AsQueryable(); var dataTablePager = new DataTablePager<Category>(jsonAOData, json); var formattedList = dataTablePager.Filter(); return JsonConvert.SerializeObject(formattedList); } [/code] I am getting below response from web service [code] {"d":"{\"sEcho\":1,\"iTotalRecords\":8,\"iTotalDisplayRecords\":8,\"aaData\":[[\"1\",\"Beauty and Wellness\r\n\",\"True\",\"2/23/2014 11:44:42 AM\"],[\"2\",\"Leisure and Entertainment\r\n\",\"True\",\"2/23/2014 11:44:47 AM\"],[\"3\",\"Travel and Accommodation\r\n\",\"True\",\"2/23/2014 11:44:56 AM\"],[\"4\",\"Commerce\r\n\",\"True\",\"2/23/2014 11:45:02 AM\"],[\"5\",\"Services\r\n\",\"True\",\"2/23/2014 11:45:07 AM\"],[\"6\",\"Businesses\r\n\",\"False\",\"2/23/2014 11:45:11 AM\"],[\"7\",\"Health\r\n\",\"True\",\"2/23/2014 11:45:17 AM\"],[\"8\",\"Useful\r\n\",\"True\",\"2/23/2014 11:45:18 AM\"]],\"sColumns\":\"ID,,Name,,IsActive,,CreatedOn,\"}"} [/code] Issue is like when i am binding with datatable, its generating wired result It generates some thing like below [code] Actions Name IsActive CreatedOn Edit True undefined Beauty and Wellness undefined Edit True undefined Leisure and Entertainment undefined Edit True undefined Travel and Accommodation undefined Edit True undefined Commerce undefined Edit True undefined Services undefined Edit False undefined Businesses undefined Edit True undefined Health undefined Edit True undefined Useful undefined [/code] Not sure why. Can you please help me at earliest? Thanks, Nik
- 22nd Jan 2014jquery datatable plugin aadata format not displaying the tableIam newbie to jquery. Iam working with jquery datatable plugin . I tried to display the array of aadata with datatable but iam not getting datatable displayed, only empty page i could see. Can anyone help me where i went wrong? Below is the code i used. [code] $(document).ready(function () { var Listobj = new Array(); var downloadClick = "<center><img src='Image/Download.png' style='cursor:pointer' onclick=callDownload('','','','') /></center>" var callPlayVedio = "<center><img src='Image/Play.png' style='cursor:pointer' onclick=callPlayVedio('','','','') /></center>" $.getJSON("sources/jsondata.json", function (data) { var dataobj = $.parseJSON(JSON.stringify(data)); $.each(dataobj, function (key, val) { if (key == "contents") { for (var i = 0, l = val.length; i < l; i++) { var obj = val[i]; var auctualSize = ((obj.size) / 1024).toFixed(2) + " kb"; Listobj[i] = new Array(obj.key, obj.lastModified, auctualSize, downloadClick, callPlayVedio, "<center><img src='Image/share.png' style='cursor:pointer;width:16px;height:16px;'/></center>"); } } }); TableDisplay(Listobj); }); }); function TableDisplay(Tablevalues) { alert("sec"+Tablevalues); $('#table_test').html(''); $('#example').dataTable({ "aaData": Tablevalues, "aoColumns": [ { "sTitle": "Files" }, { "sTitle": "Date and Time" }, { "sTitle": "size"}, { "sTitle": "Download"}, { "sTitle": "Play"}, {"sTitle": "share"}] }); }; and my json values are var myjson='[{"isTruncated": "false","nextMarker": "null","marker": "null","prefix": "Mymedia/mysys/","contents": [{"deviceInfo": "null","lastModified": "Thu Dec 26 16:36:42 IST 2013","etag": "d41d8cd98f00b204e9800998ecf8427e","key":"Mymedia/mysys/audio_$folder$","size": "0"},{"deviceInfo": null,"lastModified": "Thu Dec 26 16:36:11 IST 2013","etag": "d41d8cd98f00b204e9800998ecf8427e","key": "Mymedia/mysys/doc_$folder$","size": "0"},{ "deviceInfo": null,"lastModified": "Thu Dec 26 16:36:20 IST 2013", "etag": "d41d8cd98f00b204e9800998ecf8427e","key": "Mymedia/mysys/imge_$folder$","size": "0"},{"deviceInfo": null,"lastModified": "Thu Dec 26 16:36:56 IST 2013","etag": "d41d8cd98f00b204e9800998ecf8427e","key":"Mymedia/mysys/others_$folder$","size": "0"},{"deviceInfo": null,"lastModified": "Thu Dec 26 16:36:32 IST 2013","etag": "d41d8cd98f00b204e9800998ecf8427e","key": "Mymedia/mysys/video_$folder$","size": "0"}],"name": "name", "statusCode": "200","statusMessage": "Success","error": null}]'; [/code]
- 8th Jan 2014Struggling with table rendering if bStateSave is enabledI have this issue in chrome jquery.dataTables.js:6705 Cannot read property 'asSorting' of undefined and firefox, same line, but a different error TypeError: oColumn is undefined I have seen lots of posts about this but cannot debug it or find a definitive answer, (if there is one). I’m guessing there must be a conflict somewhere, but can’t work out where. I found the debug bookmarklet, and uploaded the offending page, code iwucul Looking through the debug code, i found one thing which may be relevant "saved_aaSorting": "[[0,\"desc\",1]]" on the page with the fault, compared to "saved_aaSorting": [ [3, "asc", 0] ], on a page which runs ok
- 17th Dec 2013Table wont dispaly anything?Here's my debug info: http://debug.datatables.net/uyoqog Regards, Vrutin
- 5th Dec 2013table tools cancel call back function ?Hello All, I hope someone could help me or throw me any idea as I could not find a call back function in the following scenario : CSV/Excel export : There is fnComplete call back function, which get called after "Save" button clicked on modal window. [quote] Is there any specific call back function that gets called when "Cancel" button clicked on modal window ? [/quote] I would like to do alerting the user after save or cancel happens. I appreciate any help! Thanks, Sri
- 4th Dec 2013Table Cell style depend on valueIs it possible to style (by css class) a single cell depend on value?
- 5th Nov 2013Concat whit Data table editorHi I wonder if it is possible to use concat or group_concat in the Datatableeditor tnks
- 17th Oct 2013How to hide the aoColumns when the table content is empty (no rows)I want to be able to hide the column headers when the query returns 0 records. But i still want to have the sEmptyTable message show in the footer. Is there a way to do this ?
- 4th Sep 2013How can i add few more filtering in data table?good day, Could anyone please share with me how can i add more filter criteria and improve the searchable result? Thanks
- 31st Aug 2013jQuery UI themed table with FixedColumns fixed column cannot sort problemform this demo "http://datatables.net/release-datatables/extras/FixedColumns/themed.html" when themed with jQuery UI then fixed column why cannot sort the first column that Fixed?