Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Input Masks
12/06/2009
22:35
Avatar
Romyn
Member
Members
Forum Posts: 45
Member Since:
13/06/2009
sp_UserOfflineSmall Offline

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)

17/06/2009
10:35
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

17/06/2009
21:34
Avatar
Romyn
Member
Members
Forum Posts: 45
Member Since:
13/06/2009
sp_UserOfflineSmall Offline

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 🙂

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information