i am developing web application using asp.net mvc 4.
I am trying to load editable data-table with ajax call to controller. while calling ajax ..it will execute and return data but in console it give me error like "Cannot read property 'style' of undefined".
i am trying following code
Here is my javascript
var editor; // use a global for the submit and return data rendering in the examples //$(document).ready(function () { debugger; editor = new $.fn.dataTable.Editor({ ajax: "PRC/PRCGenerate", table: "#example", fields: [{ label: "PQTY", name: "PQTY" }, { label: "PRCReadyDT", name: "PRCReadyDT" }, { label: "REMARKS:", name: "REMARKS" } ] }); // Activate an inline edit on click of a table cell $('#example').on('click', 'tbody td.editable', function (e) { editor.inline(this); }); $('#example').DataTable({ dom: 'Bfrtip', ajax: 'PRC/PRCGenerate', columns: [ { data: null, defaultContent: '', className: 'select-checkbox', orderable: false }, { data: 'OANO' }, { data: 'ID' }, { data: 'PONO' }, { data: 'POLI' }, { data: 'MOULDCODE' }, { data: 'DESCRIPTION' }, { data: 'Drg' }, { data: 'Rev' }, { data: 'METALCODE' }, { data: 'METALNAME' }, { data: 'WEIGHT' }, { data: 'QTY' }, { data: 'PQTY', className: 'editable' }, { data: 'Machining' }, { data: 'PRC' }, { data: 'DELIVERYDT' }, { data: 'PRCReadyDT', className: 'editable' }, { data: 'PRCNO' }, { data: 'REMARKS', className: 'editable' } //render: $.fn.dataTable.render.number(',', '.', 0, '$'), ], select: { style: 'os', selector: 'td:first-child' }, buttons: [ { extend: 'create', editor: editor }, { extend: 'edit', editor: editor }, { extend: 'remove', editor: editor } ] }); //});
Here is my html page
@model IEnumerable
| @Html.DisplayNameFor(model => model.OANO) | @Html.DisplayNameFor(model => model.ID) | @Html.DisplayNameFor(model => model.PONO) | @Html.DisplayNameFor(model => model.POLI) | @Html.DisplayNameFor(model => model.MOULDCODE) | @Html.DisplayNameFor(model => model.DESCRIPTION) | @Html.DisplayNameFor(model => model.Drg) | @Html.DisplayNameFor(model => model.Rev) | @Html.DisplayNameFor(model => model.METALCODE) | @Html.DisplayNameFor(model => model.METALNAME) | @Html.DisplayNameFor(model => model.WEIGHT) | @Html.DisplayNameFor(model => model.QTY) | @Html.DisplayNameFor(model => model.PQTY) | @Html.DisplayNameFor(model => model.Machining) | @Html.DisplayNameFor(model => model.PRC) | @Html.DisplayNameFor(model => model.DELIVERYDT) | @Html.DisplayNameFor(model => model.PRCReadyDT) | @Html.DisplayNameFor(model => model.PRCNO) | @Html.DisplayNameFor(model => model.REMARKS) |
|---|
This is my Output With error.

How can i solve this.? please Help Me.. thanks in advance.:-)
Niharika VachhaniPosted Feb 6, 2019, 3:57 AM
Niharika VachhaniPosted Feb 6, 2019, 3:56 AM
Vivek KumarPosted Feb 6, 2019, 3:40 AM
Salman BegPosted Feb 6, 2019, 3:39 AM
Madan ShekarPosted Feb 6, 2019, 3:32 AM
or