Hi!
i am trying to use 2 kind of showing data:
grid and dataview.I use s combo to select which of the two to choose.
when one of those is shown the other disappears.I also use a textbox to search the data.
The problem is when i make a search the shown element(grid) is filtered(parsed with the corresponding data), but the hidden element(dataview) is not parsed with the data.
The question is :How can i get or set the data of a hidden element?
{type:“clean”,
cols:[
{view:"combo",id:"sid",name:"sid", label:"View As", yCount:"2",align:"center",options:viewtypes},
{view:"text",id:"lid",name:"lid", labelWidth:30, label:"<img id='imgsettings', height='29', style=\"padding-top:2px;\" src=\"resources/images/tabbar/settings.png\">", align:"right",popup:"tes" },
{view:"combo",id:"filter",name:"filter", label:"Filter", yCount:"3",align:"center",options:filter},
// { view:"imagebutton", id:"imgsettings", name:"imgsettings", align:"right",src:"resources/images/tabbar/settings.png",popup:"tes"}
]
},
{cols:[
{view:“dataview”,id:“test”,width:widthdiv,type:{template:"#title#Status: #status# Owner: #smownerid#Customer: #accountid#Product: #prod_id#",height:80},select:true, data:vals},
{view:“grid”,id:“mygrid”, scroll:true,fields: arrfieldsgrid,datatype:“json”, data:vals}
]
}…
…
$$(“test”).hide();
$$(“mygrid”).show();
$$(“sid”).attachEvent(“onChange”,function(oldvalue,value){
if(oldvalue==‘dataview’){
viewdata=true;
viewgrid=false;
$$(“test”).show();
$$(“mygrid”).hide();
}
else {
viewgrid=true;
viewdata=false;
$$("test").hide();
$$("mygrid").show();
}
});
…
…
function afterCall(text,xml){
var datax = dhx.DataDriver.json.toObject(text,xml);
$$(“mygrid”).clearAll();
$$(“mygrid”).parse(datax);
$$(“test”).clearAll();
$$(“test”).parse(datax);
}
So i clear and parse the hidden dataview but when i click to show it, it contains the old datasource.
Please help me!
Thanks in advance.