jQWidgets Forums

jQuery UI Widgets Forums Grid not fill the rows, but leaves empty

This topic contains 3 replies, has 2 voices, and was last updated by  Hristo 8 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • not fill the rows, but leaves empty #92410

    dave11
    Participant

    I built a grid with the following code:

    source = {
    	            localdata: jsondati.dati,
    	            datatype: 'json',
    	            addrow: function (rowid, rowdata, position, commit) {
    	                commit(true);
    	            }
    	        };
    	        var cellclass = function (row, columnfield, value) {
    	            if (buttonClick != -1) {
    	                if (buttonClick == row)
    	                    return "highlightsClass";
    	            }
    	        };
    	        var columns = [
                            { text: titleGrid[0], datafield: 'puntointeresse', align: 'center', cellsalign: 'left', width: 100, cellclassname: cellclass, index: 0 },
                            { text: titleGrid[1], datafield: 'indirizzo', align: 'center', cellsalign: 'left', cellclassname: cellclass, index: 1 },
                            { text: "Categoria", datafield: 'tipopuntointeresse', align: 'center', cellsalign: 'center', width: 100, cellclassname: cellclass, index: 2 },
                            {
                                text: "", datafield: "FasciaOraria", align: "center", cellsalign: "center", width: 40, editable: false, sortable: false, cellclassname: cellclass,
                                cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) {
                                    
                                    var eventName = "onClick";
                                    return defaulthtml.replace(">" + value, "><a " + eventName + "='ShowDetails(" + row + ", event)' style='color: #3d4a77;' href='javascript:;'><i class='icon icon-marker1' style='font-size: 17px; cursor: pointer;'></i></a>");
                                },
                            }
    	                ];
    	        var hq = $("#jqxWidget").css("height");
    	        try {
    	            $("#jqxgrid").jqxGrid(
                    {
                        width: 602,
                        height: hq,
                        source: source,
                        altrows: true,
                        sortable: true,
                        editable: false,
                        selectionmode: 'singlerow',
                        scrollbarsize: 6,
                        columns: columns,
                    });
    	            Visualizza();
    	        } catch (e) {
    	            var qwerty = e.message;
    	        }

    but it happens that does not fill all the rows, but fills and two other leaves them empty (example image). I tried to see but it seems to run fine. I do not know what happens …
    You could help, pre pleasure?

    not fill the rows, but leaves empty #92446

    Hristo
    Participant

    Hello dave11,

    You should set a DataAdapter. Please, take a look at this demo:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/defaultfunctionality.htm?light

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    not fill the rows, but leaves empty #92458

    dave11
    Participant

    Hello Hristo,
    the problem is not on the DataAdapter. I have been a lot of time looking at the page, and in the various events (type: given that nonetheless seemed to me the scroll, I shrugged and I looked the other rows) I noticed that the DataAdapter and there was “complete.”
    I entered the table in the event “ready” the “updatebounddata” and then I appear all rows.
    I do not know why, where depends on the problem, unfortunately I had to do it this way.
    Many thanks Hristo.

    not fill the rows, but leaves empty #92491

    Hristo
    Participant

    Hello dave11,

    I checked your source and I do not see the DataAdapter.
    Please, take a look at this forum topic:
    http://www.jqwidgets.com/community/topic/grid-data-source-not-from-jqxdataadapter/#post-42084

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.