jQuery UI Widgets Forums Grid Is there a default row displaying after initializing the grid?

This topic contains 2 replies, has 2 voices, and was last updated by  midi 12 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • midi
    Participant

    Hi all,

    My code for constructing the grid is as follows:


    $("#grid").jqxGrid(
    {
    width: 350,
    height: 100,
    source: dataAdapter,
    theme: theme,
    columnsresize: true,
    columns: [
    { text: '1', dataField: 'field1', width: 50, cellsalign: 'right' },
    { text: '2', dataField: 'field2', width: 50, cellsalign: 'right' },
    { text: '3', dataField: 'field3', width: 50, cellsformat: 'c', cellsalign: 'right' },
    { text: '4', dataField: 'field4', width: 50, cellsalign: 'right' },
    { text: '5', dataField: 'field5', width: 50, cellsformat: 'c', cellsalign: 'right'},
    { text: '6', dataField: 'field6', width: 50, cellsalign: 'right'},
    { text: '7', dataField: 'Add', columntype: 'button', width: 50, cellsrenderer: function (row) {
    return "Add Carrier";
    }}
    ]
    });

    Is it the fact that by default there is one row(row No.0) displayed after initialization when there’s a column whose columntype is set to ‘button’? Because I see there’s only one button shown in the row and nothing else. And how to delete the empty row?

    Can you help me with above issue?

    Best Regards,
    midi


    Dimitar
    Participant

    Hello midi,

    Can you please send us your entire page source code, so that we can determine the exact reason for the issue.

    Best Regards,
    Dimitar

    jqWidgets team,
    http://www.jqwidgets.com/


    midi
    Participant

    Hi Dimitar,

    I’ve just found the solution for this problem. I just added the definition of an array variable which is used to store the fetched result retrieved from database, shown as follows:

    $blocks = array();
    while($row = mysql_fetch_array($result,MYSQL_ASSOC))
    {
    $blocks[] = array(
    'id_block' => $row['id_block'],
    'content' => $row['content'],
    'market' => $row['market'],
    'premium' => $row['premium'],
    );
    }

    I lost ‘$blocks = array();’ before, that’s why the problem occured.

    Thanks.
    midi

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

You must be logged in to reply to this topic.