Forum
23:44
17/05/2010
I'm using custom cell editing. Here is my code.
colModel: [{ name: 'name', index: 'name',width:'90px',align:"center",editable:true,classes:"editable",edittype:'custom',editoptions:{custom_element:mycampaignname, custom_value:mycompaignvalue}},......],
// I'm adding div + textbox + save button when that cell is editable: I don't know other way around so I just did this way.
function mycampaignname (value, options)
{
var eldiv = document.createElement("div");
eldiv.value = value;
var el = document.createElement("input");
el.type ="text";
el.value = value;
var br = document.createElement('br');
var elb = document.createElement("input");
elb.type="button";
elb.value = "save";
elb.style.width="45%";
elb.style.styleFloat = "right";
elb.onclick = SaveBtnClick;
var hiddeninput=document.createElement("input");
hiddeninput.id ="hiddenvalue";
hiddeninput.value=value;
eldiv.appendChild(el);
eldiv.appendChild(br);
eldiv.appendChild(elb);
return eldiv;
}
function mycompaignvalue(elem)
{
return $(elem).val();
}
Now this is working fine upto this point. Now I want to add send data to server on save button click event. How can I do that?
& Also if I put cancel button along with save then when I click cancel how does cell get back to its original value.(just like when you click on outside editable cell)
Thanks,
A
Most Users Ever Online: 715
Currently Online:
38 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66