$(function () {
$("#Grid").ejGrid({
// the datasource "window.gridData" is referred from jsondata.min.js
dataSource: window.gridData,
allowPaging: true,
allowGrouping: true,
groupSettings: { groupedColumns: ["ShipCountry", "ShipCity"] },
columns: [
--------
],
dataBound: function (args) {
this.collapseAll();
}
});
$("#Grid .e-gnextforward").mousedown(function (e) { // bind mouse down event for expand icon
//DO your operations here
});
});
|
$(".e-recordpluscollapse[ej-mappingname = '" + gridObj.model.groupSettings.groupedColumns[0] + "']").mousedown(function (e) { // bind mouse down event for expand icon
var gridObj = $("#Grid").ejGrid('instance');
for (var i = 1 ; i < gridObj.model.groupSettings.groupedColumns.length ; i++) {
var target = $(".e-recordpluscollapse[ej-mappingname = '" + gridObj.model.groupSettings.groupedColumns[i] + "']") //target of expand icons
for (var count = 0 ; count < target.children().length; count++)
gridObj.expandCollapse(target.children().eq(count));
}
});
|
$(".e-recordpluscollapse[ej-mappingname = '" + gridObj.model.groupSettings.groupedColumns[0] + "']").mousedown(function (e) { // bind mouse down event for expand icon
var gridObj = $("#Grid").ejGrid('instance');
var target = $(e.currentTarget).parent();
if (!target.next().hasClass("e-groupcaptionrow")) {
var rows = target.next().find('.e-table.e-recordtable tr');
for (var i = 0 ; i < rows.length ; i++ )
gridObj.expandCollapse($(rows).eq(i).find("td.e-detailrowcollapse")); // expand the detail row
}
});
|