jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 111 total)
  • Author
    Posts

  • simcon94
    Participant

    But at me, the createeditor isn’t call once. It calls it every times. And the source didn’t refresh or update. Do you have an example?


    simcon94
    Participant

    and how can i update?
    But in these line:
    console.log(“grid : ” + comboEntries);

    the entries are correct…..why this?


    simcon94
    Participant

    comboEntries is updated. See this is my console:
    1.
    grid : Counter_0.0,Counter_0.1,Counter_0.2,Counter_0.3,Counter_11,Motor,Steckdose,Test_Counter,Group_901,1
    createeditor : Counter_0.0,Counter_0.1,Counter_0.2,Counter_0.3,Counter_11,Motor,Steckdose,Test_Counter,Group_901,1
    initeditor : Counter_0.0,Counter_0.1,Counter_0.2,Counter_0.3,Counter_11,Motor,Steckdose,Test_Counter,Group_901,1

    2.
    grid : Counter_0.0,Counter_0.1,Counter_0.2,Counter_0.3,Counter_11,Motor,Steckdose,Test_Counter,Summen 1,1
    createeditor : Counter_0.0,Counter_0.1,Counter_0.2,Counter_0.3,Counter_11,Motor,Steckdose,Test_Counter,Group_901,1
    initeditor : Counter_0.0,Counter_0.1,Counter_0.2,Counter_0.3,Counter_11,Motor,Steckdose,Test_Counter,Group_901,1

    The First call is correct. the second is wrong. The second call has the same entries then the first call……

    Thats my code:

    
            var meterSource;
            meterSource =
            {
                datatype: "json",
                datafields: [
                    { name: 'Id', type: 'string' }
                    , { name: 'Number', type: 'string' }
                    , { name: 'Name', type: 'string' }
                ],
                // get Model Data
                url: sk.appHelper.getAppDomainAppVirtualPath() + "/Meter/GetMetersToAttach?meterId=" + id
                , async: false
                //, cache: false
            };
    
            var comboEntries = new Array();
            var meterDataAdapter = new $.jqx.dataAdapter(meterSource, {
                autoBind: true,
                beforeLoadComplete: function (records) {
                    comboEntries = new Array();
                    // update the loaded records. Dynamically add EmployeeName and EmployeeID fields. 
                    for (var i = 0; i < records.length; i++) {
                        var name = records[i].Name;
                        comboEntries.push(name);
                    }
                    return comboEntries;
                }
            });
            
            console.log("grid      : " + comboEntries);
    
            // initialize jqxGrid
            $("#gridAttachedMeters").jqxGrid(
                {
                    width: popUpWidth - 10
                    , autoheight: true
                    , source: data
                    , selectionmode: 'singlecell'
                    , editable: true
                    , columnsresize: true
                    , showtoolbar: true
                    , altrows: true
                    , statusbarheight: 25
                    , rendertoolbar: function (toolbar) {
                        var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
                        var addButton = $("<div style='float: left; margin-left: 5px;'><img style='position: relative; margin-top: 2px;' src='Content/icons/new.png'/></div>");
                        container.append(addButton);
                        toolbar.append(container);
                        addButton.jqxButton({ width: 60, height: 20 });
                        // add new row.
                        addButton.click(function () {
                           
                            $("#gridAttachedMeters").jqxGrid('addrow', 'MeterId', {}, "first");
                            
                        });
                    }
                    , columns: [
                        { text: "Id ", datafield: "Id", width: 1, hidden: true}
                        , { text: "MeterNumber", datafield: "MeterNumber", width: 1, hidden: true }
                        , { text: '@Resources.Meter.MeterModel_AttachedMeter', columntype: 'combobox', displayfield: "Name", datafield: "AttachedMeterId", width: '90%', 
                            createeditor: function (row, cellvalue, editor) {
                                console.log("createeditor: " + comboEntries);
                                editor.jqxComboBox({ source: comboEntries, displayMember: 'Name', valueMember: 'Id', width: '88%' });
                            }
                            , initeditor: function (row, cellvalue, editor) {
                                console.log("initeditor: " + comboEntries);
                                editor.jqxComboBox({ source: comboEntries });
                            }
                            // update the editor's value before saving it.
                            , cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
                                // return the old value, if the new value is empty.
                                if (newvalue == "") return oldvalue;
                            }  
                       }
                            , {
                                text: '-', datafield: 'Delete', columntype: 'button', width: '10%', align: 'center', cellsrenderer: function () {
                                    return "-";
                                }
                                , buttonclick: function (row) {
                                    // get the clicked row's data and initialize the input fields.
                                    var rowid = $('#gridAttachedMeters').jqxGrid('getrowid', row);
                                    $('#gridAttachedMeters').jqxGrid('deleterow', rowid);
                                }
                                , aggregatesrenderer: function (aggregates, column, element) {
                                    var renderstring = "<div class='jqx-widget-content' style='float: left; width: 100%; height: 100%; '/>";
                                    return renderstring;
                                }
                            }
                    ]
                });
    

    simcon94
    Participant

    Can you post an example?
    I have the version 3.3.0 of jqWidget….


    simcon94
    Participant

    Yes, i try it:

    createeditor: function (row, cellvalue, editor) {
                                console.log("initeditor: " + comboEntries);
                                editor.jqxComboBox({ source: comboEntries, displayMember: 'Name', valueMember: 'Id', width: '88%' });
                            }
                            , initeditor: function (row, cellvalue, editor) {
                                console.log("initeditor: " + comboEntries);
                                editor.jqxComboBox({ source: comboEntries });
      
                            }
    

    But in the console.log() never shown the new values


    simcon94
    Participant

    i have createeditor and initeditor…but still not working.
    I am only want to laod the source new……:-(


    simcon94
    Participant

    Does it works?
    I have the same problem with the source….i can’t refresh the source

    in reply to: Click Legend Click Legend #54726

    simcon94
    Participant

    With “Leave the Side” i mean, when i load another side from my application and the i go back o the chart side…
    I have a side with table and one side with chart. So when i click on legend to hide some lines from my chart, then i go to my tyble side and the i go on next step to chart side, the hidden lines are still hidden.
    So i want, when i go to my table side, that all lines will be shown on next time, when i go to chart side…

    in reply to: Grid Filterrow Grid Filterrow #54669

    simcon94
    Participant

    Do you have an example?

    in reply to: Grid Filterrow Grid Filterrow #54644

    simcon94
    Participant

    This happen is jqxgrid.filter.js in row :1190
    var tmpvalue = new Date(cell);

    Cell Value =”0002″ -> Date {Tue Jan 01 0002 01:00:00 GMT+0100}

    in reply to: Grid Filterrow Grid Filterrow #54642

    simcon94
    Participant

    I found the problem.
    The Values in Json 2 in Cell Nr is
    0002
    9003
    and so on. This Value he can parse to an date.
    Thats the reason….
    So the next problem is, that the datafields: [] must be dynamic.
    How can i do that?

    in reply to: Grid and Validator Grid and Validator #53727

    simcon94
    Participant

    When i add a new row to grid, then i would o highlight a cell in grid

    in reply to: Grid and Validator Grid and Validator #53711

    simcon94
    Participant

    I would change the cell to life time.

    in reply to: Performance dataAdapter Performance dataAdapter #53240

    simcon94
    Participant

    This is not the solution for me.
    Every Time when i change the page in grid, it will take for seconds…..
    Thers no other solution or workaround?


    simcon94
    Participant

    when will it relesead?

Viewing 15 posts - 31 through 45 (of 111 total)