jQuery Events in jqGrid (still without form editing and tree grid modules) #236

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
3 participants
@OlegKi
Contributor

OlegKi commented Jan 5, 2012

The changes are made based on my suggestion http://www.trirand.com/blog/?page_id=393/feature-request/usage-of-jquery-events-in-jqgrid-together-with-callback-functions-used-currently/#p25559

jqGridGridComplete, jqGridLoadComplete are introduced to make some default actions, like project defaults.

jqGridAfterGridComplete, jqGridAfterLoadComplete are introduced to make some corections after possible grid modification inside of loadComplete method.

TODOs:
I didn't introduced events for grid.formedit.js and grid.treegrid.js

In the grid.formedit.js one should choose the name converstion for the events. One can share one event for add and edit row, but include options as additional parameter (like in inline edit).
Additionally one should set grid as this in all callback of grid.formedit.js (use .call($t, ...))

Signed-off-by: Dr. Oleg Kiriljuk oleg.kiriljuk@ok-soft-gmbh.com

@wildraid

This comment has been minimized.

Show comment
Hide comment
@wildraid

wildraid Jan 5, 2012

Very nice! Events are the biggest thing i've missed in jqGrid.

wildraid commented Jan 5, 2012

Very nice! Events are the biggest thing i've missed in jqGrid.

OlegKi added some commits Jan 14, 2012

Synchronization of the searching toolbar contain with the current val…
…ues from postData.filters

Signed-off-by: Dr. Oleg Kiriljuk <oleg.kiriljuk@ok-soft-gmbh.com>
fill the contain of the searching toolbar based on the postData.filte…
…rs at the end of the toolbar creation.

Signed-off-by: Dr. Oleg Kiriljuk <oleg.kiriljuk@ok-soft-gmbh.com>
set this for formatters and unformatters
Signed-off-by: Dr. Oleg Kiriljuk <oleg.kiriljuk@ok-soft-gmbh.com>
extend options of formatter with the information from the colNames fo…
…r the column.

Signed-off-by: Dr. Oleg Kiriljuk <oleg.kiriljuk@ok-soft-gmbh.com>
If cell contain has complex structur then `e.target` from the `click`…
… event on the cell can be a child element of `<td>`. If inside of `onSelectRow` the `editRow` will be called the contain of the `<td>` will be overwritten by `<input>` or other control.

In the case the `e.target` will be *modified*. The DOM element `e.target` will be not more the child of the `<td>` and `e.target.parentNode` will be set to `null`.

The old (current) code of jqGrid called `$.jgrid.getCellIndex(td)` *after* the `setSelection`. So inside of [the line](https://github.com/tonytomov/jqGrid/blob/v4.3.1/js/grid.base.js#L37) exception will be fired. In the case not only `c.parentNode.cells` could be not calculated in IE, but even `c` will be undefined because `c` calculated as `c.closest("td,th")[0]` will be `undefined`.

To fix the bug will be suggested to change the order of `onCellSelect` and `setSelection` or `editCell` calls.

Signed-off-by: Dr. Oleg Kiriljuk <oleg.kiriljuk@ok-soft-gmbh.com>

@tonytomov tonytomov closed this Jan 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment