jQWidgets Forums

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts

  • Lee
    Participant

    Thanks!


    Lee
    Participant

    Hi Peter

    It’s the same problem in demo Master-Detail. I explain it with photo Photo illustration

    Here is a lite code but it doesn’t work. My idea is to loop through the source data and unselect all the rows.
    My code works only in our CRM so it doesn’t work in your local environment.

    In my code, records is the name of an array.

    $(“#attributeGrid”).jqxGrid({
    ready: function () {
    var len = records.length;
    for (i = 0; i < len; i++) {
    $(‘#attributeGrid’).jqxGrid(‘unselectrow’, i);
    }
    },
    width: 680,
    source: dataAdapter,

    ….

    Regards
    Lee


    Lee
    Participant

    Hello,

    Thanks for your tips. “drop-grid” in your demo is in unbound mode. Is it possible to bind “drop-grid” to data to show what man dragged into the drop-grid?

    Regards
    Lee


    Lee
    Participant

    Hi
    I explain my question lite more:
    How to save the values that man drag and drop into another grid?

    regards
    Lee


    Lee
    Participant

    Hi Peter,

    Have you example using array. I used datafield and datadisplay but it doesn’t work for me 🙁

    Best regards
    Lee


    Lee
    Participant

    HI,

    Can you help me with group function doesn’t work with separate datafield and displayfield?

    Best regards,
    Lee


    Lee
    Participant

    Hi Peter

    Here is sample of code I used. Before I use datafield and displayfield, grouping function worked. But after that it doesn’t work for that column.

    var groupsrenderer = function (text, group, expanded, data) {
    if (data.groupcolumn.datafield == 'date' || data.groupcolumn.datafield == 'staff'
    || data.groupcolumn.datafield == 'projectactivity' || data.groupcolumn.datafield == 'invoicedstatus'
    || data.groupcolumn.datafield == 'billable') {
    if (data.subItems.length > 0) {
    var aggregate = this.getcolumnaggregateddata("billablehours", ['sum'], true, data.subItems);
    }
    else {
    var rows = new Array();
    var getRows = function (group, rows) {
    if (group.subGroups.length > 0) {
    for (var i = 0; i < group.subGroups.length; i++) {
    getRows(group.subGroups[i], rows);
    }
    }
    else {
    for (var i = 0; i < group.subItems.length; i++) {
    rows.push(group.subItems[i]);
    }
    }
    }
    getRows(data, rows);
    var aggregate = this.getcolumnaggregateddata("billablehours", ['sum'], true, rows);
    }
    return '<div class="' + toThemeProperty('jqx-grid-groups-row') + '" style="position: absolute;"><span>' + text + ', </span>' + '<span class="' + toThemeProperty('jqx-grid-groups-row-details') + '">' + "Total" + ' (' + aggregate.sum + ')' + '</span></div>';
    }
    else {
    return '<div class="' + toThemeProperty('jqx-grid-groups-row') + '" style="position: absolute;"><span>' + text + '</span>';
    }
    }
    // initialize jqxGrid
    $("#jqxgrid").jqxGrid(
    {
    width:1000,
    source: dataAdapter,
    theme: theme,
    groupable: true,
    groupsrenderer: groupsrenderer,
    // selectionmode: 'singlecell',
    showstatusbar: true,
    statusbarheight: 0,
    editable: true,
    filterable: true,
    sortable: true,
    altrows: true,
    ready: function () {
    addfilter();
    },
    autoshowfiltericon: true,
    showaggregates: true,
    columns: [
    { text: 'Date', columntype: 'textbox', groupable: true, datafield: 'date', columntype: 'datetimeinput', cellsformat: 'yyyy.MM.dd', width: 120},
    { text: 'Staff Name', groupable: true, datafield: 'staffid', displayfield:"staff", width: 150, columntype: 'dropdownlist',
    createeditor: function (row, value, editor) {
    editor.jqxDropDownList({ source: staffnameList, displayMember: 'Name', valueMember: 'Id' });
    }
    },
    { text: 'Hours', groupable: true, datafield: 'billablehours', width: 120, cellsalign: 'center', cellsformat: 'n1', aggregates: ['sum', 'avg'],
    aggregatesrenderer: function (aggregates) {
    var renderstring = "";
    $.each(aggregates, function (key, value) {
    var name = key == 'sum' ? 'Total' : 'Avg';
    renderstring += '<div style="position: relative; margin: 4px; overflow: hidden;">' + name + ': ' + value +'</div>';
    });
    return renderstring;}},
    { text: 'Billable', groupable: true, datafield: 'billable', width: 125, columntype: 'checkbox',
    aggregates: [{ 'Billable':
    function (aggregatedValue, currentValue) {
    if (currentValue) {
    return aggregatedValue + 1;
    }
    return aggregatedValue;
    }
    },
    { 'Unbillable':
    function (aggregatedValue, currentValue) {
    if (!currentValue) {
    return aggregatedValue + 1;
    }
    return aggregatedValue;
    }
    }
    ]
    },
    { text: 'Billable Des.', groupable: true, datafield: 'billabledescription', width: 150, columntype: 'textbox'},
    { text: 'Project Activity', groupable: true, datafield: 'projectactivity', columntype: 'dropdownlist'},
    ],
    });

    Best regards,
    Lee


    Lee
    Participant

    Hi Peter,

    I did look at the posted sample and used lastest version. It display displayfield but that didnot work when I tried to group that column like this link

    Best Regards,
    Lee


    Lee
    Participant

    Hi,

    I cannot group the column with seperate datafield and displayfield t.ex. datafield: ‘countryCode’, displayfield: ‘Country’.
    How to set data.groupcolumn.datafield??? Neither ‘countryCode’ nor ‘Country’ works. Thanks!

    Best Regards,
    Lee

    in reply to: SubTotal in grouping SubTotal in grouping #21595

    Lee
    Participant

    Thanks, Dimitar, it works.

    Regards,
    Lee

    in reply to: Problem with CRM Problem with CRM #21554

    Lee
    Participant

    I received those errors:

    Uncaught TypeError: Cannot call method ‘jqxWidget’ of undefined new_jqxgrid.js:7
    Uncaught TypeError: Cannot set property ‘dataAdapter’ of undefined new_jqxdata.js:7
    Uncaught TypeError: Cannot call method ‘jqxWidget’ of undefined new_jqxmenu.js:7
    Uncaught TypeError: Cannot set property ‘cssroundedcorners’ of undefined new_jqxbutton.js:7
    Uncaught TypeError: Cannot read property ‘_jqxGrid’ of undefined new_jqxgrid.aggregates.js:7
    Uncaught TypeError: Cannot read property ‘_jqxGrid’ of undefined new_jqxgrid.edit.js:7
    Uncaught TypeError: Cannot read property ‘_jqxGrid’ of undefined new_jqxgrid.selection.js:7
    Uncaught TypeError: Cannot call method ‘jqxWidget’ of undefined

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