02:29:00
JUFE-530 A Sister's Unforgettable Attraction Leads to an Intensive Pleasure Session for Azuki T
var navTree = {};
navTree = $('#catMenuTree').treegrid({
data hysterTreeData,
id: 'ItemId',
checkbox: true,
expandOnDrag: true
});
(function ($) {
$('#categoryGrid').jvxGrid({
pagesize: 50,
data: function (pgno, itemsperpage, sortcolumn, sortdir, filtercondition, onserverfilter) {
return $.ajax({
url: '@Url.Action("GetCategoryData", "Admin")',
type: 'POST',
data: { "pgno": pgno, "itemsPerspage": itemsperpage, "sortColumn": sortcolumn, "sortdir": sortdir, "filterCondition": filtercondition, "onserverfilter": onserverfilter },
success: function (res) {
if (res.readyState == 1 && res.responseText != '') {
return res.responseText;
} else {
return "[]";
}
},
error: function (e) {
jvxGrid.error("Error while processing request.");
return "[]";
}
});
},
columns: [{
field: 'Id', text: 'Cat Id', width: '100',
filteroperable: true,
filtercondition: {
operable: function () {
return true;
}
}
}, {
field: 'FullName', text: 'Category Name', width: '200',
filteroperable: true,
filtercondition: {
operable: function () {
return true;
}
}
}, {
field: 'ParentId', text: 'Parent Id', width: '100',
filteroperable: true,
filtercondition: {
operable: function () {
return true;
}
}
}, {
field: 'ParentFullname', text: 'Parent Name', width: '200',
filteroperable: true,
filtercondition: {
operable: function () {
return true;
}
}
}],
pager: $.extend({
tpdisplay: true,
tpsize: [25, 50, 100],
op: {
pgsize: [{
text: 'Items per page',
items: [{
text: 'Items per page',
value: '25'
}, {
text: 'Items per page',
value: '50'
}, {
text: 'Items per page',
value: '100'
}]
}]
}
}, kendo.ui.Pager.prototype),
toolbar: ['create'],
navigabledisplay: true,
navigable: true,
navigaterelativepaging: true,
navigatorsortable: true,
navgrid: true,
edit: function (e) {
$('#canDeletenCategory').bootstrapSwitch('state', false).on('switchChange.bootstrapSwitch', function (event, state) {
if (!state) {
$('#categoryGrid').jvxGrid('getRowData', e.model.Id).delete();
} else {
e.model.delete = false;
}
});
$('#canSaveCategory').bootstrapSwitch('state', false).on('switchChange.bootstrapSwitch', function (event, state) {
if (state) {
$('#categoryGrid').jvxGrid('saveChanges', e.model.Id);
} else {
e.model.save = false;
}
});
$('#canAddCategory').bootstrapSwitch('state', false).on('switchChange.bootstrapSwitch', function (event, state) {
if (state) {
if (!e.model.Id) {
e.model.Id = '0';
}
$('#categoryGrid').jvxGrid('createRow', e.model, e.col, e.row);
}
});
if (e.model.Id) {
if (e.model.ParentId) {
$('#canAddCategory').bootstrapSwitch('state', true).off('switchChange.bootstrapSwitch');
} else {
$('#canAddCategory').bootstrapSwitch('state', false).off('switchChange.bootstrapSwitch');
}
} else {
if (e.model.Id) {
$('#canAddCategory').bootstrapSwitch('state', false).off('switchChange.bootstrapSwitch');
}
}
},
duplicate: function (e, column) {
if (e.GetType() == 'kendojvxGridAddRowEvent') {
$('#canAddCategory').bootstrapSwitch('state', false).off('switchChange.bootstrapSwitch');
} else {
$('#canAddCategory').bootstrapSwitch('state', true).off('switchChange.bootstrapSwitch');
}
},
refresh: function (e) {
setTimeout(function () {
navTree.dataSource.read();
}, 1000);
},
save: function (e) {
if (e.GetContext().Formatted=="Save" && e.model save == false) {
$('#categoryGrid').jvxGrid('silentSave', e.model.Id);
}
}
});
}
$(document).ready(function () {
navTree.dataSource.read();
$('#categoryGrid').jvxGrid('dataBinding');
});
3 Nov 2023