tedt3

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • in reply to: addXmlData local with pager rowid bug #99723
    tedt3
    Participant

    Thanks for the suggestion to assign the row id using the id attribute for the row tag.

    in reply to: addXmlData local with pager rowid bug #99718
    tedt3
    Participant

    I've already tried the 0 based vs 1 based loop.

    in reply to: addXmlData local with pager rowid bug #99716
    tedt3
    Participant

    No I'm pretty sure it's not my code that is causing this. I've created a small example that does the same thing.

    Here is a sample xml file

    <!–

    row1

    row2

    row3

    row4

    row5

    –>

    And here is a sample html page. Notice I have rowNum set to 2 in my grid so it only shows 2 rows at a time.

    <!–

    function fillGrid()

    {

    var colModelArray = [{name:'col1', index:'col1', sortype:'string', editable:false}];

    var colNamesArray = ['Column1'];

    jQuery(“#grid”).jqGrid({

    datatype: “xml”,

    url: “data.xml”,

    colNames: colNamesArray,

    colModel: colModelArray,

    height: 'auto',

    autowidth: true,

    rowNum: 2,

    pager: '#grid_pager',

    rowList:[2, 5],

    viewrecords: true,

    loadonce: true,

    processing: true

    });

    jQuery(“#grid”).navGrid('#grid_pager',{edit:false,add:false,del:false,search:true,refresh:false});

    }

    function checkRows()

    {

    var TotalRows = $(“#grid”).getGridParam(“records”);

    var debugStr = “

    “;

    Row Data

    for (var i = 1; i <= TotalRows; i++)

    {

    var rowObj = $('#grid').getLocalRow(i);

    debugStr = debugStr + “

    ” + i + “ ” + rowObj.col1 + “

    “;

    }

    debugStr = debugStr + ““;

    $('#grid_debug').html(debugStr);

    }

    $(document).ready(function(){

    fillGrid();

    });

     

    –>

    After the page loads if you hit the Check Grid Rows Button you will see the following:

    Row Data

    1 row1

    2 row3

    3 row4

    4 row5

    5 undefined

    Notice how Row 2 doesn't show row2 instead it shows row3. Now if I keep all the code above identical except change rowNum parameter of the grid to 3 I get this:

    Row Data

    1 row1

    2 row2

    3 row4

    4 row5

    5 undefined

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

Stay connected with us in your favorite flavor!