<ej:Gantt ID="Gantt" runat="server" ToolbarClick="toolbarClick"
//..
>
<ToolbarSettings ShowToolbar="true">
<CustomToolbarItems>
<ej:GanttCustomToolbarItem Text="Save" TooltipText="Save" />
</CustomToolbarItems>
</ToolbarSettings>
</ej:Gantt>
function toolbarClick(args){
if (args.itemName == "Save") {
var columns = args.model.columns,
cName = [], cVisible = [];
for (var i = 0; i < columns.length; i++) {
if (columns[i].mappingName) {
cName.push(columns[i].mappingName);
cVisible.push(columns[i].visible);
}
}
$.ajax({
type: "POST",
url: '/GanttSample.aspx/updateColumnData',
async: false,
data: JSON.stringify({name:cName.toString() ,visible: cVisible.toString()}),
contentType: "application/json; charset=utf-8",
dataType: "json",
});
}
} |
function load(args) {
var columns = this.getColumns(),
cName = [],cVisible = [];
$.ajax({
//..
success: function (result) {
var col = result.d;
cName = col.Name.split(','),
cVisible = col.Visible.split(',');
}
})
for (var i = 0; i < cName.length; i++) {
var temp = {},cIndex = -1;
$.each(columns, function (index, col) {
if (col.mappingName == cName[i]) {
col.visible = cVisible[i] == "true"? true : false;
temp = col;
cIndex = index;
return false;
}
});
|
Thanky you
One of the best Supports I have ever seen :-)