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
json add form problem. .removeAttr("readonly") to work the column still disabled
12/02/2014
09:30
Avatar
shilo.k
Member
Members
Forum Posts: 8
Member Since:
26/05/2013
sp_UserOfflineSmall Offline

hello all

in add action i want to remove the readonly attribute from column "applName" To enable Enter values in .

so i use this command :

    $("#id.applName", formid).removeAttr("readonly");

 but it  not work  and the column still disabled from update.

before, where my jsonString was simple, like :

 {"id":"10","applName":"appl1","group":"g1",field:"f1"}

  the command :  $("#applName", formid).removeAttr("readonly");  work well

but now because new  jsonString sturcture :

{"id":{"applName":"appl1","group":"g1"},field:"f1"}

i must used   $("#id.applName", formid).removeAttr("readonly");

and there no error message and  the column still disabled for update

my jqgrid source:

jQuery("#listsg11").jqGrid({
 
url:'<%=request.getContextPath()%>/ViewAppl?oper=select',
 editurl:'<%=request.getContextPath()%>/ViewAppl',
 datatype: "json",
 jsonReader : {
     root: "rows",
     page: "page",
     total: "total",
     records: "records",
     repeatitems: true,
     cell: "",
     width:400,
     id: "0"},

....

colNames:['id','applName','groupName', 'description', 'applExit','applSource'],
    colModel:[
     {name:'id',index:'id',hidden:true, width:55, editable: true,editoptions: {maxlength:8, readonly: 'readonly' }},
     {name:'id.applName',index:'id.applName', width:55, editable: true,editoptions: {maxlength:8, readonly: 'readonly' }},
     {name:'id.groupName',index:'id.groupName', width:90,editable: true,editoptions: {maxlength:8}},
     {name:'description',index:'description', width:100,editable:true,color:'blue',background:'background'},
     {name:'applExit',index:'applExit', width:80, align:"right",editable:true},
     {name:'applSource',index:'applSource', width:80,search:false, align:"right",editable:true,
           edittype: 'select',editoptions: {value: s:sql;b:DB2'}}
    ],
    loadonce: true,

.....

jQuery("#listsg11").jqGrid('navGrid','#pagersg11',{pgbuttons:false,search:false,view:true,add:true,edit:true,del:true},
  { // edit dialog options
    checkOnUpdate:true,
    closeAfterEdit:true,
             beforeShowForm : function (formid){
                      $("#id.applName", formid).attr("readonly","true");
             }
   },
         // Add dialog options
  {
   checkOnUpdate:true,
   closeAfterAdd:true,
    beforeShowForm : function (formid){
               $("#id.applName", formid).removeAttr("readonly");
    } 
 );

 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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