kogrid


Why do my koGrid columns go super wide when trying to make it narrower, then you can't drag it back


I am posting this in hopes that someone else will be helped.
I have a koGrid (using version 2.1.1) with about 25 columns. I have both width and minWidth set on the columns. When the grid comes up it displays ok but sometimes I want to adjust the column sizes. When I adjust the sizes the columns widths sometimes go crazy wide and you can't put them back.
I looked for hours for a solution and finally figured this out.
When you change the width of a column up or down and the size hits the "minWidth" or "maxWidth" threshold, the javascript code that calculates the width can switch to string concatenation.
As a result, if you have a column with a minWidth of 30, when you hit that point, the width gets set to the string "30". When the column sizes are then recalculated, and that column is hit, the math will start to concatenate rather than summing up.
To fix this issue, you need to modify the koGrid source file. In the debug file, search for the window.kg.Column function. About 13 lines into the method, you will find the following two lines:
self.minWidth = !colDef.minWidth ? 50 : colDef.minWidth;
self.maxWidth = !colDef.maxWidth ? 9000 : colDef.maxWidth;
change the code so it converts the min and max widths to integers as follows:
self.minWidth = !colDef.minWidth ? 50 : parseInt(colDef.minWidth, 10);
self.maxWidth = !colDef.maxWidth ? 9000 : parseInt(colDef.maxWidth, 10);
This fixed it for me and my testing did not show any side effects. I hope this helps someone else. Maybe someone will incorporate the fixes into the koGrid code base soon.

Related Links

How to restrict max rows selected to 25 in kogrid (multi selection enabled)
Why do my koGrid columns go super wide when trying to make it narrower, then you can't drag it back
Ko grid +showing column conditionally

Categories

HOME
wakanda
twig
powerpoint
battery
saml-2.0
xbee
simulink
visual-studio-emulator
square
barcode
discrete-mathematics
endeca
heap
watson-conversation
mod-security
opengl-es-3.0
speech-synthesis
eip
charles
database-connection
perlbrew
expressionengine3
tiki-wiki
siri
maze
surveymonkey
bulletphysics
ms-access-web-app
has-and-belongs-to-many
android-maps
firebase-analytics
errbot
user-defined-functions
gp
failover
custom-controls
kudu
erb
android-maps-extensions
hibernate-search
installscript
html-encode
slacktextviewcontroller
reason
google-knowledge-graph
flatmap
password-protection
metaprogramming
metawidget
cin
tasm
chronicle-map
drupal-theming
libgphoto2
clarifai
facebook-pixel
vugen
pair-programming
spring-data-couchbase
headless
filehandle
quicktime
monkey
cpu-cache
structuremap4
rsa-archer-grc
smartfoxserver
angular2-testing
preprocessor
qtplugin
iotivity
rspec2
gogs
createprocess
realsense
qbxml
jnlua
relativelayout
iokit
page.js
dronekit-android
ansi
nsurlsessiondatatask
entity-framework-4.3
cakephp-2.7
xmltype
qtwebengine
ejb-2.x
sonarqube-5.0
iso-prolog
xml-namespaces
functional-java
radiant
multiautocompletetextview
android-audiorecord
syndicationfeed
scrypt
oocss
observium
asplinkbutton
subgraph
database-create
pylucene
rmdir
commerceserver2007
undefined-index
globals
aspmenu
nstokenfield
data-mapping
dsl-tools
xpsdocument
entitykey
unmanagedresources
ifilter

Resources

Encrypt Message