jQuery UI Widgets Forums Grid How to accelerate work at the grid?

This topic contains 2 replies, has 2 voices, and was last updated by  Zabelsky 7 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • How to accelerate work at the grid? #90492

    Zabelsky
    Participant

    Hello.
    Help me please,faced with the problem
    When i click on cell and edit value, grid starts to lag and it lasts 5 seconds –
    not very long,but when constantly editing it takes a long time
    It my code :

    $scope.settings = getGridDispositionSettings();

    $scope.trailerTypes = enumToArray(Enum.TrailerTypes);
    $scope.trailerType = [];
    for (var j = 0; j < $scope.trailerTypes.length; j++) {
    $scope.trailerType.push({ Name: $scope.trailerTypes[j].description, Value: $scope.trailerTypes[j].value });
    }

    $scope.groupPlacements = enumToArray(Enum.GroupPlacementsType);
    $scope.groupPlacement = [];
    for (var j = 0; j < $scope.groupPlacements.length; j++) {
    $scope.groupPlacement.push({ Name: $scope.groupPlacements[j].description, Value: $scope.groupPlacements[j].value });
    }

    var rowEditTrailerType = function (row, column, datafield, oldValue, newValue) {
    if (oldValue != newValue) {
    var dlg = $dialogs.confirm(“Подтвердите”, “Вы уверены, что хотите сохранить изменения?”);
    dlg.result.then(function () {
    var data = new FormData();
    var tractor = $(‘#grid_disposition_main’).jqxGrid(‘getrowdatabyid’, row);
    data.append(“id”, tractor.TractorId);
    data.append(“column”, column);
    data.append(“value”, trailerType);
    dataService.trailer_editTrailerByEnumTrailerType(data);
    });
    }
    }

    var rowEditGroup = function (row, column, datafield, oldValue, newValue) {
    if (oldValue != newValue) {
    var dlg = $dialogs.confirm(“Подтвердите”, “Вы уверены, что хотите сохранить изменения?”);
    dlg.result.then(function () {
    var data = new FormData();
    var tractor = $(‘#grid_disposition_main’).jqxGrid(‘getrowdatabyid’, row);
    data.append(“id”, tractor.TractorId);
    data.append(“column”, column);
    data.append(“value”, groupPlacement);
    dataService.tractors_editTractorGroupByEnumGroup(data);
    });
    }
    }

    var trailerType = “”;
    var createeditorTrailerType = function (row, value, editor) {
    editor.jqxComboBox({ source: $scope.trailerType, displayMember: ‘Name’, valueMember: ‘Name’ });
    editor.on(‘select’, function (event) {
    trailerType = event.args ? event.args.item.originalItem.Value : null;
    });
    };

    var groupPlacement = “”;
    var createeditorGroup = function (row, value, editor) {
    editor.jqxComboBox({ source: $scope.groupPlacement, displayMember: ‘Name’, valueMember: ‘Name’ });
    editor.on(‘select’, function (event) {
    groupPlacement = event.args ? event.args.item.originalItem.Value : null;
    });
    };

    $scope.settings.source = new $.jqx.dataAdapter({ localdata: s });
    $scope.settings.showfilterrow = true;
    $scope.settings.editable = true;
    $scope.settings.selectionmode = ‘singlecell’;
    $scope.settings.editmode = ‘click’;

    $scope.settings.columns = [
    { text: “Блок”, datafield: “_blocksForTractor”, width: 80, type: “string”, filtertype: ‘checkedlist’, cellsrenderer: asColumnRender, editable: false, resizable: false, pinned: true },
    { text: “Напр”, datafield: “_direction”, width: 25, filtertype: ‘checkedlist’, resizable: false, cellsrenderer: asColumnRender, editable: false, type: “string”, pinned: true },
    { text: “Рег.Номер”, datafield: “_RegistrationNumbers”, width: 90, resizable: false, cellsrenderer: asColumnRender, editable: false, type: “string”, pinned: true },
    { text: “Экипаж”, datafield: “_Drivers”, width: 90, cellsrenderer: asColumnRender, resizable: false, editable: false, type: “string”, pinned: true },
    { text: “Вр. прицеп”, datafield: “_TempTrailerNumber”, width: 90, cellsrenderer: asColumnRender, editable: false, type: “string” },
    { text: “Приписка”, datafield: “_Registration”, width: 40, filtertype: ‘checkedlist’, cellsrenderer: asColumnRender, editable: false, type: “string” },
    { text: “Группа”, datafield: “_GroupAvto”, width: 60, filtertype: ‘checkedlist’, cellsrenderer: asColumnRender, editable: false, type: “string” },
    { text: “Тип прицепа”, datafield: “TrailerType”, width: 60, filtertype: ‘checkedlist’, columntype: ‘combobox’, cellsrenderer: asColumnRender, createeditor: createeditorTrailerType, cellendedit: rowEditTrailerType },
    { text: “Разрешения”, datafield: “_GroupPlacement”, width: 90, columntype: ‘combobox’, cellsrenderer: asColumnRender, createeditor: createeditorGroup, cellendedit: rowEditGroup }
    ];

    and initialize the grid:

    var getGridDispositionSettings = function () {
    return {
    altrows: true,
    width: “100%”,
    height: ‘100%’,
    sortable: true,
    filterable: true,
    groupable: true,
    pageable: true,
    pagesize: 200,
    showtoolbar: true,
    pagesizeoptions: [“3”, “20”, “50”, “100”],
    columnsresize: true,
    columnsreorder: true,
    localization: getLocalization(“ru”),
    rowsheight: 34,
    autoshowcolumnsmenubutton: false
    };
    };

    • This topic was modified 7 years, 5 months ago by  Zabelsky.
    How to accelerate work at the grid? #90495

    Peter Stoev
    Keymaster

    Hi AlexeyZabelsky,

    I suggest you to check your cellendedit and createeditor implementations. Otherwise, I see no reason for such behavior.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    How to accelerate work at the grid? #90698

    Zabelsky
    Participant

    Thank for the answer, Peter.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.