Forum


22:35

13/06/2009

Hi,
Sorry if this has been covered before – I've searched but can't find anything.
I have a field that is in Seconds and I understand that I can use the Formatter to display this in HH:MM:SS format. (Haven't tried it yet but it seems that would be the way to go).
My question though is for the reverse – to have a Input Mask for the user when adding/editing the field to force them to enter in __:__:__ and then store that as seconds. Can this be done within jqGrid or would I need to write extra code and/or use a separate Mask plugin.
Any pointers to how to achieve this would be greatly appreciated.
Thanks
Romyn
(using 3.5)
10:35

Moderators
30/10/2007

Hello,
Try with dataInit function to bind mask plugin to this element.
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.
21:34

13/06/2009

Thanks…
…once I work out what you mean (I'm a js newbie) I'll give that a go.
(Meanwhile if anyone has an example of this please feel free to post it)
Thanks again
Romyn
edit: that was easier than I thought...
using 3.5 and the masked input plugin linked from jQuery's site at
http://plugins.jquery.com/proj.....askedinput
when defining the Cols in the Col Model I did
{name:
'stime_duration',
index:'stime_duration',
editable:true,
editoptions:{dataInit:function(el){$(el).mask("99:99:99");}}
},
and it worked first time 🙂
Most Users Ever Online: 715
Currently Online:
26 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