Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GridUnload + pager:true = weird html #308

@aberel

Description

@aberel

@OlegKi
When use GridUnload, and then create grid again, and the option pager:true (no pager div used), the jqgrid create a "weird" div below the "gbox" div. This occurs every time is recreated the grid.
This a code example (sorry for can't give a real demo link)
As you can see, I created a button just for testing, which calls the setGrid() function, where the grid is "recreated". The first time you click the button is ok, but next time you click it, appears a thin line below the grid box (which actually is <div id="jqg1" class="ui-state-default ui-corner-bottom"></div>), and every time you recreate the grid (click the button again many times), it adds a new div like mentioned. with a new id (i.e "jqg2", "jqg3"...)
(I'm using free-jqgrid-4.13.6 with Chrome)

gridddd

<button id="testbtn">TEST</button>
<table id="myGrid"></table>

<script type="text/javascript">
$(document).ready(function() {
	$('#testbtn').on('click', function() {
		setGrid();
	})

	function setGrid() {
		myData = [
			{id:'1', a:'aaaa1', b:'bbbb1', c:'cccc1'},
			{id:'2', a:'aaaa2', b:'bbbb2', c:'cccc2'},
			{id:'3', a:'aaaa3', b:'bbbb3', c:'cccc3'},
		];
		$("#myGrid").jqGrid('GridUnload');		
		$("#myGrid").jqGrid({
			data: myData,
			datatype: "local",
			colModel: [ 
				{name:'id', label:'Id', width:50},
				{name:'a', label:'A', width:100},
				{name:'b', label:'B', width:100},
				{name:'c', label:'C', width:100},
			],
			pager: true,
			caption: 'test grid',
		})
	}
});	
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions