jQuery UI Widgets Forums DataTable DataTable addRow not working, table is in other tab

This topic contains 1 reply, has 2 voices, and was last updated by  ivailo 9 years, 2 months ago.

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

  • SumitRoy
    Participant

    Dear JQXWidget,

    I have a small application where there are two tabs. In Tab 1 I have a simple html table and in tab 2 I have two text field.
    scenario : when I filled two text fields these values are added in the html table.

    Now I have convert that simple html table to jqxDataGrid table.
    the problem is, even after running addRow method I cannot see the added row.

    here is how the table is created

    $("#psmManageTable").jqxDataTable({
            altRows: true,
            sortable: true,
            editable: false,
            width: '1092px',
            height: '350px',
            selectionMode: 'singleRow',
            columns: [
                {text: 'Serial No.', dataField: 'serialNo', width: '20%'},
                {text: 'Name', dataField: 'studentName', width: '40%'},
                {text: 'Age', dataField: 'studentAge', width: '40%'}
            ]
        });

    and here is my code for adding the record

    $("#psmManageTable").jqxDataTable('addRow', null, {
                serialNo: 1,
                studentName: "someName",
                studentAge: "10"
            }, 'last');

    One more thing to verify that my data is added or not I have performed the below code too,

    var rows = $("#psmManageTable").jqxDataTable('getRows');
            for (var i = 0; i < rows.length; i++) {
                // get a row.
                var rowData = rows[i];
                console.log(rowData);
            }

    and the output is
    Object {serialNo: 1, studentName: "12", studentAge: "33", uid: 0}

    but I cannot see the table
    so can you please tell me what should I do to successfully add the record.

    Regards
    Sumit Roy


    ivailo
    Participant

    Hi Sumit Roy,

    We tested your code and it works well.
    Probably the problem is produced from another part of your application.
    Please integrate all the parts of your code in jseditor and send link for better analyze.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.