jQWidgets Forums

Forum Replies Created

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

  • cberube
    Member

    Tried editor.jqxDropDownList(“close”); But editor is the fieldName.

    Do you have an example on how the get a handle on the editor instance.

    Thanks,


    cberube
    Member

    Finally the error is back. here is the setValResults() function.

    prt.emp.setValResults = function (row) {
    var empGrid = $(“#empGrid”);
    var cRow = empGrid.jqxGrid(‘getrowdata’, row);
    var newVLR = prt.emp.setVLR(cRow);
    var newTTR = prt.emp.setTTR(cRow);
    empGrid.jqxGrid(‘beginupdate’);
    empGrid.jqxGrid(‘setcellvalue’, row, ‘VLR’, newVLR);
    empGrid.jqxGrid(‘setcellvalue’, row, ‘TTR’, newTTR);
    empGrid.jqxGrid(‘endupdate’);
    };


    cberube
    Member

    Hi Peter,

    I found another way of doing it which makes the error disappear. This also updates the field value in order to get the right value in the setter function. There was a delay and I was getting he previous value.

    cellendedit: function (row, editor) {
    var newVal = $(‘.jqx-dropdownlist-content’).find(‘span’).eq(‘0’).text();
    $(‘#empGrid’).jqxGrid(‘setcellvalue’, row, “v1”, newVal );
    prt.emp.setValResults(row);
    },

    Lets me know if that makes sense.

    Thanks,

    in reply to: Changing field source values Changing field source values #32407

    cberube
    Member

    My source is an XML file.

    The data mapping is done as suggested:
    var dataAdapter = new $.jqx.dataAdapter(source, {
    downloadComplete: function (data, status, xhr) {
    // get the data from the XML and push it into Array.
    var records = $(source.root + ” ” + source.record, data);
    var dataToReturn = [];
    for (var i = 0; i < records.length; i++) {
    var ejc = $(records[i]).attr('EJC');
    var grp = $(records[i]).attr('GRP');

    As for the dropdownList. Right now, I am using the solutions provided another post using the initeditor callback to override the default values.

    initeditor: function (row, value, editor) {
    var EJC = $('#empGrid').jqxGrid('getcellvalue', row, "EJC");
    if (prt.emp.isEmpType2(EJC)) {
    editor.jqxDropDownList({ source: empType2.records, displayMember: 'label', valueMember: 'value' });
    }
    }

    I do all other fields mapping and calculations using the bindingcomplete event. This is a bit slow and I am trying to optimize it right now.

    Thanks,


    cberube
    Member

    What’s the best way to handle dropdownlist per row. Each row needs to bind to different values lists and it need to show the right label depending on the row type.

    var empType1val = [
    { value: 5, label: “E” },
    { value: 4, label: “K” },
    { value: 3, label: “S” },
    { value: 2, label: “N” },
    { value: 1, label: “U” }
    ];

    var empType2val = [
    { value: 3, label: “E” },
    { value: 2, label: “S” },
    { value: 1, label: “U” }
    ];

    // this only works per columns
    { name: ‘v1’, type: ‘string’, values: { source: empType1.records, value: ‘value’, name: ‘label’ } },

    text: ‘Customer First’, datafield: ‘v1’, width: ‘10%’, align: ‘center’, cellsalign: ‘center’, columntype: ‘dropdownlist’,
    createeditor: function (row, value, editor) {
    var EJC = $(‘#empGrid’).jqxGrid(‘getcellvalue’, row, “EJC”);
    if (prt.empType1.indexOf(EJC) != -1) {
    editor.jqxDropDownList({ source: empType1, displayMember: ‘label’, valueMember: ‘value’ });
    }
    else {
    editor.jqxDropDownList({ source: empType2, displayMember: ‘label’, valueMember: ‘value’ });
    }
    }


    cberube
    Member

    Looking for a way to bind to different lists. Do you have any examples on how to bind the value adapter into datafields: [].

    { name: ‘v1’, type: ‘string’, values: { source: ?.records, value: ‘value’, name: ‘label’ } },

    createeditor: function (row, value, editor) {
    if (row.empType = 0) {
    editor.jqxDropDownList({ source: empType1, displayMember: ‘label’, valueMember: ‘value’ });
    }
    else {
    editor.jqxDropDownList({ source: empType2, displayMember: ‘label’, valueMember: ‘value’ });
    }
    }

    Thanks,

    in reply to: Responsive jqxGrid Responsive jqxGrid #31650

    cberube
    Member

    Thanks, I was looking for a way to have it work side by side with a tree navigation. it gets a bit oakward when I use a fix width for tree container. Other than that works fine.

    in reply to: Responsive jqxGrid Responsive jqxGrid #31624

    cberube
    Member

    When i set grid columns in %. The scroll bar disappears.

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