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
edittype select => moving to index on edit
28/01/2009
15:41
Avatar
Styve
Styve
New Member
Members
Forum Posts: 2
Member Since:
28/01/2009
sp_UserOfflineSmall Offline

Hi, I’m new to jqGrid and let me say that it’s really a great project.

I’ve search the forum and the documentation but find no answer to my problem.

Let’s say I have a grid, with 3 columns (itemId, typeId, typeName)

typeId is hidden:true but edithidden:false (showing in editForm)
typeName is hidden:false but readonly:true (not showing in editForm)

in editForm typeId is render as select like (typeId1:typeName1;typeId2:typeName2;etc…)

When I open the editForm, the typeId select control index is 0 but I would have it to show me the index corresponding to the typeId value.

Can I change the selectedIndex in the editForm?

It cause me to have to reselect all those options when I go to the editForm.

(NOTE I have tried with onInitializeForm has suggested in another post (datepicker on editForm) but I didn't succes to hock the event. Any suggestion are welcome).

29/01/2009
06:45
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Clould yo please post your code again with onInitializeForm?

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.

29/01/2009
07:08
Avatar
Styve
Styve
New Member
Members
Forum Posts: 2
Member Since:
28/01/2009
sp_UserOfflineSmall Offline

A kick Google search this morning shows me that I was wrong..:) I was thinking the onInitializationForm was a grid Event and not a NavGrid event…

I should be ok by now I should have search more before posting, sorry for the trouble.

The code (without moving to selectedIndex, just hooking on onInitializeForm) :

jQuery(”#grid-equipement”).navGrid(”#pager-equipement”,
{refresh: true, edit: true, add: true, del: true, search: false, position:”left”},
{onInitializeForm:function(formId){alert(’ok’);}});

Thanks for you time

Solution (because I hate when I find a post in a forum that talks about my problem but didn’t explain how to fix it. )

NOTE : I use the pluggin to manipulate the select
http://www.texotela.co.uk/code.....ry/select/

jQuery(”#grid-equipement”).navGrid(”#pager-equipement”,
{refresh: true, edit: true, add: true, del: true, search: false, position:”left”},
{
// Edit option.
beforeShowForm:function(formId){
//$(”#dateFabrication”, formId).datepicker({dateFormat:”yyyy-mm-dd”});

// Ajustement des selects.
var rowId, selectValue;
rowId = $(”#grid-equipement”).getGridParam(”selrow”);
// Type équipement.
selectValue = $(”#grid-equipement”).getCell(rowId, 5);
$(”#typeId”).selectOptions(selectValue, true);
// Fournisseur.
selectValue = $(”#grid-equipement”).getCell(rowId, 7);
$(”#fournisseurId”).selectOptions(selectValue, true);

},
},
{
// Add option.
});

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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