jqxDataTable requires the following files:
jqx.base.cssjqxcore.jsjqxbuttons.jsjqxscrollbar.jsjqxlistbox.jsjqxdropdownlist.jsjqxmenu.jsjqxdata.jsjqxdata.export.jsjqxdatatable.js<script src="~/jqwidgets/jqxbuttons.js"></script>
<script src="~/jqwidgets/jqxdatatable.js"></script>
<script src="~/jqwidgets/jqxscrollbar.js"></script>
<script src="~/jqwidgets/jqxmenu.js"></script>
<script src="~/jqwidgets/jqxlistbox.js"></script>
<script src="~/jqwidgets/jqxdropdownlist.js"></script>
@model IEnumerable<jQWidgets.AspNet.Core.Models.Employee>
@{
string renderer = "function() {}";
string rendering = "function() {}";
string pagerRenderer = "function(element) {}";
string renderToolbar = "function(element) {}";
string renderStatusbar = "function(element) {}";
string aggregatesRenderer = "function(element){}"
string exportSettings = "{columnsHeader: true,hiddenColumns: false,serverURL: null,characterSet: null,collapsedRecords: false,recordsInView: true,fileName: "jqxDataTable"}";
string editSettings = "{saveOnPageChange: true, saveOnBlur: true, saveOnSelectionChange: true, cancelOnEsc: true, saveOnEnter: true, editSingleCell: false, editOnDoubleClick: true, editOnF2: true}";
}
<jqx-data-table alt-rows="true" width="850" source="Model">
<jqx-data-table-columns>
<jqx-data-table-column column-group="name" dataField="FirstName" width="100" text="First Name"></jqx-data-table-column>
<jqx-data-table-column column-group="name" dataField="LastName" width="100" text="Last Name"></jqx-data-table-column>
<jqx-data-table-column dataField="Title" width="150"></jqx-data-table-column>
<jqx-data-table-column dataField="Address" width="200"></jqx-data-table-column>
<jqx-data-table-column dataField="City" width="150"></jqx-data-table-column>
<jqx-data-table-column dataField="Country"></jqx-data-table-column>
</jqx-data-table-columns>
<jqx-data-table-column-groups>
<jqx-data-table-column-group name="name" text="Name"></jqx-data-table-column-group>
</jqx-data-table-column-groups>
</jqx-data-table>
To call a function(method), you need to pass the method name and parameters(if any)
in the UI component’s instance.
<script src="~/jqwidgets/jqxbuttons.js"></script>
<script src="~/jqwidgets/jqxdatatable.js"></script>
<script src="~/jqwidgets/jqxscrollbar.js"></script>
<script src="~/jqwidgets/jqxmenu.js"></script>
<script src="~/jqwidgets/jqxlistbox.js"></script>
<script src="~/jqwidgets/jqxdropdownlist.js"></script>
@model IEnumerable<jQWidgets.AspNet.Core.Models.Employee>
@{
string renderer = "function() {}";
string rendering = "function() {}";
string pagerRenderer = "function(element) {}";
string renderToolbar = "function(element) {}";
string renderStatusbar = "function(element) {}";
string aggregatesRenderer = "function(element){}"
string exportSettings = "{columnsHeader: true,hiddenColumns: false,serverURL: null,characterSet: null,collapsedRecords: false,recordsInView: true,fileName: "jqxDataTable"}";
string editSettings = "{saveOnPageChange: true, saveOnBlur: true, saveOnSelectionChange: true, cancelOnEsc: true, saveOnEnter: true, editSingleCell: false, editOnDoubleClick: true, editOnF2: true}";
}
<jqx-data-table width="850" source="Model" instance="getInstance()">
<jqx-data-table-columns>
<jqx-data-table-column column-group="name" dataField="FirstName" width="100" text="First Name"></jqx-data-table-column>
<jqx-data-table-column column-group="name" dataField="LastName" width="100" text="Last Name"></jqx-data-table-column>
<jqx-data-table-column dataField="Title" width="150"></jqx-data-table-column>
<jqx-data-table-column dataField="Address" width="200"></jqx-data-table-column>
<jqx-data-table-column dataField="City" width="150"></jqx-data-table-column>
<jqx-data-table-column dataField="Country"></jqx-data-table-column>
</jqx-data-table-columns>
<jqx-data-table-column-groups>
<jqx-data-table-column-group name="name" text="Name"></jqx-data-table-column-group>
</jqx-data-table-column-groups>
</jqx-data-table>
@section scripts {
<script type="text/javascript">
function getInstance(instance) {
instance["beginCellEdit"](10,'firstName');
}
</script>
}
To bind to an event of a UI Component, you can use on-event-type syntax. The example
code below demonstrates how to bind to an event.
<script src="~/jqwidgets/jqxbuttons.js"></script>
<script src="~/jqwidgets/jqxdatatable.js"></script>
<script src="~/jqwidgets/jqxscrollbar.js"></script>
<script src="~/jqwidgets/jqxmenu.js"></script>
<script src="~/jqwidgets/jqxlistbox.js"></script>
<script src="~/jqwidgets/jqxdropdownlist.js"></script>
@model IEnumerable<jQWidgets.AspNet.Core.Models.Employee>
@{
string renderer = "function() {}";
string rendering = "function() {}";
string pagerRenderer = "function(element) {}";
string renderToolbar = "function(element) {}";
string renderStatusbar = "function(element) {}";
string aggregatesRenderer = "function(element){}"
string exportSettings = "{columnsHeader: true,hiddenColumns: false,serverURL: null,characterSet: null,collapsedRecords: false,recordsInView: true,fileName: "jqxDataTable"}";
string editSettings = "{saveOnPageChange: true, saveOnBlur: true, saveOnSelectionChange: true, cancelOnEsc: true, saveOnEnter: true, editSingleCell: false, editOnDoubleClick: true, editOnF2: true}";
}
<jqx-data-table on-binding-complete="eventHandler()">
<jqx-data-table-columns>
<jqx-data-table-column column-group="name" dataField="FirstName" width="100" text="First Name"></jqx-data-table-column>
<jqx-data-table-column column-group="name" dataField="LastName" width="100" text="Last Name"></jqx-data-table-column>
<jqx-data-table-column dataField="Title" width="150"></jqx-data-table-column>
<jqx-data-table-column dataField="Address" width="200"></jqx-data-table-column>
<jqx-data-table-column dataField="City" width="150"></jqx-data-table-column>
<jqx-data-table-column dataField="Country"></jqx-data-table-column>
</jqx-data-table-columns>
<jqx-data-table-column-groups>
<jqx-data-table-column-group name="name" text="Name"></jqx-data-table-column-group>
</jqx-data-table-column-groups>
</jqx-data-table>
@section scripts {
<script type="text/javascript">
function eventHandler(event) {
}
</script>
}