I think the “$.jgrid.extend is not a function” error may be due to your imports being in the wrong order.
I realize this is long after the fact, but in case anyone else is looking to solve a similar problem (extra content on cell hover).
You can use cluetip plugin or similar to accomplish this.
The problem I've seen is with the pager, which chokes on rowNums it doesn't like 'All','0' will end up returning NaN values in recordtext.
The way I've gotten around this is to add a rowNum option of 100000000 or some other arbitrarily huge #, and then add a jquery call to make the pulldown look nice:
add to grid options:
|
1 2 3 4 |
rowList:[10,20,30,100000000],<br /> loadComplete: function() {<br /> $("option[value=100000000]").text('All');<br /> } |
YMMV. It would be nice if jgGrid had an elegant built in way to handle this.
Or, without having to modify grid.base:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
<br /> add to options:<br /> <br /> gridComplete: function() {<br /> $(".cbox").shiftSelect();<br /> },<br /> <br /> add elsewhere:<br /> <br /> jQuery.fn.shiftSelect = function() {<br /> var checkboxes = this;<br /> var lastSelected;<br /> var executing = false;<br /> jQuery(this).click( function(event) {<br /> <br /><br /> if (executing)<br /> return;<br /> <br /><br /> if ( !lastSelected ) {<br /> lastSelected = this;<br /> return;<br /> }<br /> <br /><br /> if ( event.shiftKey ) {<br /> var selIndex = checkboxes.index(this);<br /> var lastIndex = checkboxes.index(lastSelected);<br /> /*<br /> * if you find the "select/unselect" behavior unseemly,<br /> * remove this assignment and replace 'checkValue'<br /> * with 'true' below.<br /> */<br /> var checkValue = lastSelected.checked;<br /> if ( selIndex == lastIndex ) {<br /> return true;<br /> }<br /> executing = true;<br /> var end = Math.max(selIndex,lastIndex);<br /> var start = Math.min(selIndex,lastIndex);<br /> for(i=start;i<=end;i++) {<br /> if (checkboxes<i>.checked != checkValue)<br /> $(checkboxes</i><i>).click();<br /> }<br /> executing = false;<br /> }<br /> lastSelected = this;<br /> });<br /> }<br /> <br /> </i> |
shiftSelect lifted from: http://clownsinmycoffee.net/20…..th-jquery/
for whatever reason “setSelection” doesn't work for me (it sets the background grey, but doesn't set the checkbox to checked).
After you create your grid:
$(“.GridHeader”).append($(“#pager2”));
I think the missing detail is to pass an array of dom elements to your grid_options pager value.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top