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 for update multple columns groups
04/12/2012
20:08
Avatar
KristKing
Chile
New Member
Members
Forum Posts: 2
Member Since:
04/12/2012
sp_UserOfflineSmall Offline

Hi,

thank you very much for this application and excuse my english.

but I have a problem, I carry an array with the data

var mydata = { "C":{                "A":[{"IND":"1","RUT_DESP":"1111111","NOMBRE_DESP":"nombre1 nombre2 apellido1 apellido 2"},{"IND":"1","RUT_DESP":"33333","NOMBRE_DESP":"nombre1 nombre2 apellido1 apellido 2"}], "B":[{"IND":"1","RUT_DESP":"222222","NOMBRE_DESP":"nombre1 nombre2 apellido1 apellido 2"}]                     },                "T":{                "A":[{"IND":"1","RUT_DESP":"1111111","NOMBRE_DESP":"nombre1 nombre2 apellido1 apellido 2","CASO":"122-k"}], "B":[{"IND":"1","RUT_DESP":"555555","NOMBRE_DESP":"nombre1 nombre2 apellido1 apellido 2","CASO":"122-k"}]                     },             }

and whit select change the data

$("#grupo").change(function(){ $('#list4').jqGrid("clearGridData", true); var componente = $("#componente").val(); var grupo = $("#grupo").val();     for(var i=0 ; i<= mydata[componente][grupo].length ; i++) { jQuery("#list4").jqGrid('addRowData',i+1,mydata[componente][grupo][i]); } });

 but the columns do not match and I have to remove (not hide) or add some and not how I had updateColumns thought the idea is generarme JSON array with columns like data, is able to do that?

04/12/2012
21:50
Avatar
KristKing
Chile
New Member
Members
Forum Posts: 2
Member Since:
04/12/2012
sp_UserOfflineSmall Offline

so, i solved 

html

  </div>    <table id="list4"></table><div id="centerCuerpo">

first load into $(document).ready(

jQuery("#list4").jqGrid( { datatype: "local", height: 350, width: 420, colNames:['#','RUT', 'NOMBRE'], colModel:[ {name:'IND',index:'IND', width:20,align:'center'}, {name:'RUT_DESP',index:'RUT_DESP', width:100,align:'center'}, {name:'NOMBRE_DESP',index:'RUT_DESP', width:300,editable:true}, ], multiselect: true, caption: "caption caption" });

onchange or click any event

$("#prueba").click(function(){ $('#centerCuerpo').html(''); var elem = $(document.createElement('table')).attr('id','list4').appendTo('#centerCuerpo'); var componente = $("#componente").val(); var grupo = $("#grupo").val(); jQuery("#list4").jqGrid( { datatype: "local", height: 350, width: 720, colNames: myConfigColum[colNames][componente][grupo], colModel: myConfigColum[colModel][componente][grupo], multiselect: true, caption: "caption of caption" }); });

not very elegant but it works

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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