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
Select value when enter a cell (celledit)
12/11/2009
03:42
Avatar
birt
Member
Members
Forum Posts: 20
Member Since:
20/11/2008
sp_UserOfflineSmall Offline

Hello!

I'm using celledit (jqGrid ver 3.5.3) and wonder if there is any way to make a value selected immediately when enter the cell with celledit. The main purpose is for cells with value=0. When edit a cell like that you have to first erase the "0" and then enter the new value. Otherwise the new value will be the "0" concatenated with the entered value (like 065). It doesn't look very nice.

/birt

12/11/2009
11:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Sorry - do not understand.

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/11/2009
09:23
Avatar
birt
Member
Members
Forum Posts: 20
Member Since:
20/11/2008
sp_UserOfflineSmall Offline

Yes, I know it was kind of cryptic question. I will try to eplain better:

I would like to enter especially numbers/digits to a cell (using celledit) without having to erase to old value first. I would like the old value to be deleted or selected immediately when "opening" the cell. Something like this:

http://i37.tinypic.com/292b1jn.jpg

As I wrote the main purpose is for cells with value=0. When opening a cell like this:

http://i36.tinypic.com/fdhv9c.jpg

If I type a value (56) without deleting the old it will look like this (not desired):

http://i37.tinypic.com/28quiv5.jpg

(But what I want is this:)

http://i38.tinypic.com/2w3xmrd.jpg

I realize that this is maybe not a very big or common problem but do you have any solution that I can try??

regards

birt

17/11/2009
00:42
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

use afterEditCell something like this

...

afterEditCell : function(rowid, name, value, iRow, iCol) {

$("#"+iRow+"_"+name,"#mygrid").select();

}

...

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.

19/11/2009
19:32
Avatar
jpalac
Australia
Member
Members
Forum Posts: 38
Member Since:
19/08/2009
sp_UserOfflineSmall Offline

Hi,

I'd also like to achieve the same effect. The above suggestion works, however if I press Esc to cancel out of cell editing I lose the keyboard navigation (ie pressing the arrow buttons no longer does anything - the focus is else where). The problem does not occur if I change the value of the cell and press Enter. If value is not changed and Enter is pressed the problem still occurs.

Regards,

Jo

21/11/2009
08:01
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Seems like with select() we loose the focus. try select().focus() - not sure if this is the appropriate approach.

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.

23/11/2009
08:12
Avatar
birt
Member
Members
Forum Posts: 20
Member Since:
20/11/2008
sp_UserOfflineSmall Offline

Thanks Tony!

For me it seems to work with both select() and select().focus() in FF, might be browser dependent?

However, I can feel that the focus sometimes becomes elsewhere after editing a cell in IE8. This happens independent of if the function you suggested is active or not. It looks like if the cell width is decreased and then you can't navigate with the keyboard's arrow buttons any more.

Regards

birt

23/11/2009
12:12
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Also maybe the right code should use setTimeout - i.e:

setTimeout(function() { $(”#”+iRow+”_”+name,”#mygrid”).select().focus();},10);

Good practice is to use setTimeout when you try to focus some element. (instead that the timeout can be 0)

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

23/11/2009
17:32
Avatar
jpalac
Australia
Member
Members
Forum Posts: 38
Member Since:
19/08/2009
sp_UserOfflineSmall Offline

Hi,

Yes it works in firefox but not in IE8 - have tried both normal and compatibility mode. The focus is shifted to the IE scrollbars.

Regards,

Jo

24/11/2009
06:06
Avatar
birt
Member
Members
Forum Posts: 20
Member Since:
20/11/2008
sp_UserOfflineSmall Offline

Hi again,

Are there any changes to this behaviour (the focus moved to the IE8 scrollbars after saving cell) in jqGrid 3.6??

Will it work better if I upgrade jqGrid?

/birt

24/11/2009
17:02
Avatar
jpalac
Australia
Member
Members
Forum Posts: 38
Member Since:
19/08/2009
sp_UserOfflineSmall Offline

Hi,

I'm using jqGrid 3.6.1 and having this problem. It's strange as if you change the cell value then the focus is ok - it's only if you leave the value unchanged (ie RestoreCell is called instead of SaveCell) that the focus changes to the IE scrollbars.

Regards,

Jo

25/11/2009
09:30
Avatar
birt
Member
Members
Forum Posts: 20
Member Since:
20/11/2008
sp_UserOfflineSmall Offline

Hi,

It is a bit strange because my experience is that it to work the other way, Ok when leaving without save (pressing Esc) and "hangs" when saving (pressing Enter). For text fields I also notice that the width of the current cell is changed a bit when saved. (The right border is moved a bit to the left.) Do you have the same issue?

/birt

25/11/2009
17:18
Avatar
jpalac
Australia
Member
Members
Forum Posts: 38
Member Since:
19/08/2009
sp_UserOfflineSmall Offline

Hi,

Yes that happens if you use IE8 without the compatibility mode switched on. If you switch it on then it fixes the alignment issues.

I've looked into it and it happens outside of the jqgrid as well - ie it's an IE8 bug.

Regards,

Jo

27/11/2009
08:45
Avatar
birt
Member
Members
Forum Posts: 20
Member Since:
20/11/2008
sp_UserOfflineSmall Offline

Jo,

Thank you for clarifying this!

regards

birt

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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