jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 39 total)
  • Author
    Posts

  • andy8
    Participant

    Hi Peter,

    Thanks – do you mean something like this?

    columns: [{
        text: 'Factors',
        datafield: 'factors',
        width: 80,
        columntype: 'custom',
        createeditor: function (row, cellvalue, editor, cellText, width, height) {
            editor.jqxNumberInput({
                decimalDigits: 4,
                inputMode: 'simple',
                max: 0,
                min: 1,					
                theme: theme,
                value: 0,
                spinButtons: true,
                spinMode: 'advanced'
            });
            },
        initeditor: function (row, cellvalue, editor, celltext, pressedkey) {
                editor.jqxNumberInput({
                    decimal: parseFloat(cellvalue),
                    max: GlobalMin,
                	min: GlobalMax,					
                });
        }, 

    and define vars GlobalMin and GlobalMax globally?


    andy8
    Participant

    Finally, I’ve managed to get it fixed. The problem was not because of “ready/not ready” DOM elements, but because I was rendering the jqxGrid to the same div without destroying the old grid first. In the old version, it worked fine though. So, the remedy was to add

    $('#gridID).jqxGrid('destroy');

    – before rendering a new grid into the same div. The ‘destroy’ command also deletes the grid div, so it is necessary to recreate the div before rendering a new grid.


    andy8
    Participant

    Hi Peter,

    Thanks, I will try to extract a part of the code for debugging. I guess, something has changed in the sync/async options… I keep digging….


    andy8
    Participant

    Hi Peter,

    I had to try “on ready”, because my old code was not working with 3.2.2. Now it generates an error:

    “jqxGrid: The data is still loading. When the data binding is completed, the Grid raises the ‘bindingcomplete’ event. Call this function in the ‘bindingcomplete’ event handler. “

    If I remove the part after “statusbar.append(container);” nor errors are generated

    You may test yourself – this code works fine with the old versions, but not with the latest ones (obviously, something has changed):

    $("#jqxGrid").jqxGrid({
    	.......
    
        renderstatusbar: function (statusbar) {
        	var container = $("<div class='btn_cont'></div>");
        	var sel = $("<div id='h_options' style='font-size: 10px;float:left; margin-left:8px;'><input id='w_base' type='radio' name='hopt' checked='checked' value='1'/><label for='w_base'>Weights</label><input id='h_base' type='radio' name='hopt' value='2'/><label for='h_base'>Positions</label></div> ");
            container.append(sel);
            statusbar.empty();
            statusbar.append(container); 
            
            //all manipulations with the created DOM
            $("#h_options").buttonset();
            $("#h_options").jqxTooltip({
                content: 'Positions entry',
                position: 'mouse',
                theme: theme
            });  
            //this part of the code causes "bindingcomplete" error in v 3.2.2           
        },
        .....
        .....
    });

    Any suggestions?

    Thanks!


    andy8
    Participant

    Peter, what has changed in the latest release? Why DOM elements created inside “renderstatusbar” are not ready anymore? The above code has been working perfectly fine for “centuries” 🙂

    What I am saying that it would be nice to maintain the core sync functionality across the latest releases.


    andy8
    Participant

    Further to my previous post. Prior to v.3.2.2 I have been using the following structure with no problems:

    $("#jqxGrid").jqxGrid({
    	.......
    
        renderstatusbar: function (statusbar) {
        	var container = $("<div class='btn_cont'></div>");
        	var sel = $("<div id='h_options' style='font-size: 10px;float:left; margin-left:8px;'><input id='w_base' type='radio' name='hopt' checked='checked' value='1'/><label for='w_base'>Weights</label><input id='h_base' type='radio' name='hopt' value='2'/><label for='h_base'>Positions</label></div> ");
            container.append(sel);
            statusbar.empty();
            statusbar.append(container); 
            
            //all manipulations with the created DOM
            $("#h_options").buttonset();
            $("#h_options").jqxTooltip({
                content: 'Positions entry',
                position: 'mouse',
                theme: theme
            });              
        },
        .....
        .....
    });

    It doesn’t work anymore, because the new elements created inside “renderstatusbar” are not ready. I had to revert to the old v.3 until get some stable solution for that….


    andy8
    Participant

    Hi Peter,

    Thanks. It would be, perhaps, a nice feature in your coming release – just to have an option to render the statusbar and aggregates into two different divs.

    Best,
    Andy


    andy8
    Participant

    Thanks, Dimitar! It works fine.

    in reply to: Grid float cells sort problem Grid float cells sort problem #32957

    andy8
    Participant

    Got it fixed – data type “float” in the data adapter was missing.

    What will happen if we try to render a string in a column of “float” type? Will it revert to a string type for the whole column?

    Thanks


    andy8
    Participant

    Thanks, Peter.

    Actually, the column is not defined as numeric. It is populated from json string, while some values are numeric and some – strings. Everything works fine until I try to enter strings into cells with previous numeric values.

    It is not a big deal as I can convert all values to strings before rendering.


    andy8
    Participant

    I have figured it out. If a tooltip element (the one to which a tooltip is attached) is destroyed before attampting to destroy its tooltip, an orphan tooltip div remains on the page.

    If I destroy a tooltip first (i.e. $(“div.abc”).jqxTooltip(‘destroy’)) and its element second, everything works fine.

    in reply to: Grid export throws an error Grid export throws an error #32026

    andy8
    Participant

    I know that, but it looks as Grid export conflicts with other libraries. I have almost all jQWidgets js libraries loaded. Everything works perfectly fine Grid, dropdowns, sliders etc

    But with export functions I am havi ng a problem. If I load 2 export libraries at the end of other jQWidgets libs, it throws an exception “0 is not a function” in the mootools-core.js.

    But if I load these just after the jQWidgets core and data libraries, it throws another error:

    “Uncaught jqxCore: invalid parameter ”[exportdata, xls, search-res] doesn’t exists”

    Nothing to do with mootools.

    in reply to: Pinned and resizable columns Pinned and resizable columns #31851

    andy8
    Participant

    Thank you, Peter. Everything works ok.


    andy8
    Participant

    The update:

    this code is working…. seems to be related to object referencing for multiple rows.

      var rows = [];
    var res = data.res;
    $.each(res, function (key, val) {
    var newf = val;
    var serObj = {
    id: newf[0],
    fund: newf[1]
    };
    rows.push(serObj);;
    });
    $("#curr_wallet").jqxGrid('beginupdate');
    $("#curr_wallet").jqxGrid('addrow', null, rows);
    $("#curr_wallet").jqxGrid('endupdate');

    andy8
    Participant

    Thanks Dimitar! It works!

Viewing 15 posts - 16 through 30 (of 39 total)