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
Form using setColProp
19/08/2008
04:05
Avatar
garnett21
Member
Members
Forum Posts: 17
Member Since:
02/08/2008
sp_UserOfflineSmall Offline

Hi all,

I would like to have two different form to edit my grid.One to add rows and an other to edit row.

so I've made 2 functions

 function edit(idSubGrid){
  var id = jQuery("#"+idSubGrid).getGridParam('selrow');
  if (id) { 

   var ret = $("#"+idSubGrid).getRowData(id); 

   $("#"+idSubGrid).setColProp('num',{editable:true});
   $("#"+idSubGrid).setColProp('name',{editable:true});
   $("#"+idSubGrid).setColProp('surname',{editable:false});
    //on affiche le formulaire de modification
   $("#"+idSubGrid).editGridRow(
    ret.idPerson,
    {
     editCaption: "Edit a person",
     reloadAfterSubmit:true,
     closeAfterEdit:true,
     height:310
    }
   );
  } else {
   alert("Please select row");
  }
 }
 
 function add(idSubGrid){
   //definition des données editbables
   $("#"+idSubGrid).setColProp('surname',
          {
           editable:true,
          });
   $("#"+idSubGrid).setColProp('num',{editable:false});
   $("#"+idSubGrid).setColProp('name',{editable:false});
   $("#"+idSubGrid).setColProp('surname',{editable:true});

   $("#"+idSubGrid).editGridRow(
    "new",
    {
     addCaption: "Add a Person",
     reloadAfterSubmit:true,
     closeAfterEdit:true,
     height:100
    }
   );
 }

as you can see to edit a grid I want to set 2 fields (num & name) and to add a row i just need to set only one field (surname).

For the edit form I set the to columns I want to complete as 'editable' and the one I don't want to complete as 'non-editable'.

For tha add form I set the surname field as 'editable' and the other columns as 'non-editable'

So when I want to add something, it works I got a form with the field I want to complete.But if I want to edit something i got the same form instead of a form with 2 fields.

I wonder myself if the setColProp methods are working properly?

19/08/2008
04:40
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

If you use jqGrid version 3.2.1 there was a bug in setColProp.

Switch to last one.

Reagrds

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/08/2008
05:02
Avatar
garnett21
Member
Members
Forum Posts: 17
Member Since:
02/08/2008
sp_UserOfflineSmall Offline

Sorry,

but i'm using the last one...Cry

19/08/2008
05:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

If this is the full code you have error in function add

function add(idSubGrid){
   //definition des données editbables
   $(”#”+idSubGrid).setColProp('surname',
          {
           editable:true,
          });

...

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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