Forum


19:24

27/07/2009

I'm looking to make a custom cell editor. My first inclination was to step in with an afterEditCell callback and overwrite the input element that had been created. This doesn't work as far as I can tell because the input element is not in the DOM at that point.. anything I write into that cell will get overwritten with the input tag apparently after this callback is through.. I tried to log to the firebug console the contents of the cell and there's no input tag when logged at the beginning of the call back..
Am I right in thinking that is how it happens? and is there a better callback or a different way of approaching this that I'm missing?
If you are curious, I need an HTML editor in there with support for some character based tags (like strong, em, subscript, superscript)..
DescSuit
00:53

Moderators
30/10/2007

Hello,
You want to overwrite the input element with what?
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.
03:37

Moderators
30/10/2007

Hello,
Maybe (never try) you will need to set edittype:'textarea' and the use dataInit event (see docs) to attach the editor to this field.
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.
17:09

27/07/2009

As I see it the dataInit function passes you the element but it isn't in context.. therefore you can edit the element (change attributes of the element, callbacks, etc.. of in this case the textarea) but you can't change what the element is. If it was a container element I could change what it contained.. or if there was a place to put other content that wasn't overwritten with by the element I could still insert something and hide the text area.. but there isn't.
So I don't see how to solve this short of adding my own edittype. Which seems a little scary, but might be doable. It'd be nicer if there was some kind of extension point there.. but as it is I'll have to have a custom version of the grid javascript.
I figure I'll have to add cases to: createEl, saveRow, editCell, saveCell (for some reason editRow doesn't seem to mention textareas at all.. hrmm..
The only alternative I can think of is if there is a callback that occurs after the editing element is put in place.. but I haven't found one.
Alan
05:36

Moderators
30/10/2007

Hello,
afterEditCell is a event which is called after the element is created and inserted into the grid.
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.
13:59

27/07/2009

I know afterCellEdit is supposed to be after the tag is in place, but when I print the html of the cell during the callback it shows no textarea.. just what was there to start. jQuery wouldn't find the textarea... etc...
When I've tried to write my own content in there during the afterCelEdit, it gets overwritten by the textarea tag.
Is the textarea special?
Alan
01:41

Moderators
30/10/2007

Hello,
If you print the html using jQuery html you will have in all cases the content and not the element.
You should make difference between the html and the element.
I think that this is possible - just try to attach the editor to the element (not to the html) and you will see the result.
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.
Most Users Ever Online: 715
Currently Online:
85 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