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
Lock while editing a form
07/10/2008
08:42
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

Hi.

I have a data table with two fields. Id and name and I would like to "lock" the id while I am editing a record. I would like to show disable or readonly but I need unprotected while adding a record..

It could be done ?

TIA

07/10/2008
09:16
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Get the last 3.3 version and use onBeforeInit event  again with setColProp

method

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.

07/10/2008
10:52
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

Thanks Tony.

I wrote

   beforeInitData: function(formId) {
                 jQuery("#list").setColProp('co_resultado', {editoptions:{edithidden:true}});
              },

However when the form is shown the field still appears and it's editable...

I would like to show it but let it readonly or protected...

07/10/2008
11:12
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

In my edit options I change my beforeInitData function to :

    beforeInitData: function(formId) {
                 jQuery("#list").setColProp('co_resultado', {editable:false});
              },

And in my Add options

    beforeInitData: function(formId) {
                 jQuery("#list").setColProp('co_resultado', {editable:true});
              },

And works OK

Thanks again Tony...

07/10/2008
11:23
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

Tony, is it possible "inject" code to a field using editoptions. I mean something like :

 jQuery("#list").setColProp('co_resultado', {editoptions:{onfocus: "this.blur()"}}) ;

I tested but it does not work... Is there another way to do that ?

TIA

08/10/2008
02:39
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Since it is very interested could you please test if this work:

jQuery(”#list”).setColProp('co_resultado',

{editoptions:{onfocus: "alert('Hello World')"}}) ;

i.e. do not use this.blur()

I think it should work

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.

08/10/2008
09:25
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

Tony, it works as expected, shows "Hello World" so each time the 'co_resultado' field geo focus the message is shown. Now How to protected the field from editing ?

Doing some experiments I wrote

    jQuery("#list").setColProp('co_resultado', {editoptions:{onfocus: "this.blur()"}});

And works the way I wanted...

What do you think ?

08/10/2008
09:27
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

Ooops!

Now when I tried to add a new record I can not be able to give focus to the 'co_resultado' so now I can see your point...

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
87 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