Forum
10:45
17/05/2009
Hello tony,
thanks for the wonderfull jquery tool! I have the need to remember changes to the width of columns of jQuery.
That is: changes done by the enduser, dragging and dropping the columns-separators.
I suggest adding a new event-Property onChangeWidth.
Documentation: onChangeWidth(index, newWidth) -> gets called everytime the width of one column is changed; default: null, nothing is done. Index is the index of the changed column, newWidth is the width after the change
That patch adds 3 lines to grid.base.js; the default is no cahnge in behaviour to now. I hereby submit this change to the Public Domain.
best wishes
Harald
diff --git a/js/grid.base.js b/js/grid.base.js
index 7fc3c4a..2635e78 100644
--- a/js/grid.base.js
+++ b/js/grid.base.js
@@ -43,6 +43,7 @@ $.fn.jqGrid = function( p ) {
onRightClickRow: null,
onPaging: null,
onSelectAll: null,
+ onChangeColWidth:null,
loadComplete: null,
gridComplete: null,
loadError: null,
@@ -156,6 +157,8 @@ $.fn.jqGrid = function( p ) {
this.sDiv.scrollLeft = this.bDiv.scrollLeft;
}
}
+ if($.isFunction(p.onChangeColWidth))
+ {p.onChangeColWidth(idx, nw);}
}
},
scrollGrid: function() {
10:47
Moderators
30/10/2007
Hello,
Thanks for this.
If you use 3.5 version this is not needed. When the width of some column is changed it is automatically updated in colModel. So in this case you just needs getGridParam.
Regards
TOny
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
02:46
17/05/2009
>If you use 3.5 version this is not needed. When the width of some column is changed it is automatically updated in >colModel. So in this case you just needs getGridParam.
Thanks for this information!
But is there also an event fired that signals "hey, the user changed the width of some column" ?
Because that was the main reason for my patch, I need to get noticed that the colModel has changed.
best wishes,
Harald
Most Users Ever Online: 715
Currently Online:
47 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66