Author Topic: custom editor parameter  (Read 2062 times)

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 148
    • View Profile
custom editor parameter
« on: January 19, 2019, 02:35:45 pm »
I have custom editors this way

Code: [Select]
var HucreS = function (ui) {
var $cell = ui.$cell
,rowData = ui.rowData
,rowIndex=ui.rowIndx
,dataIndx = ui.dataIndx
,width = parseInt(ui.column.width) - 40
,cls = ui.cls
,dc = $.trim(rowData[dataIndx]);
$cell.append("<input type='text'  name='" + dataIndx + "' id='" + dataIndx + "' value='" + dc + "' class='" + cls + " fl ls'  style='z-index: 40000;width:" + width + "px;' autocomplete='off'/>"
+"<span class='ui-widget-header fl ek' onclick=\"window.parent.Popuir('../Liste.asp?js=10&l=gssk&e="+rowIndex+"&a=KOD|ADI&v=KOD|ADI',760,540,'Liste');\"><i class='ui-icon ui-icon-search ck'></i></span>"
+"<span class='ui-widget-header fl ek' onclick=\"window.parent.Popuir('../Kart.asp?menu=h&KOD="+dc+"',960,540,'Kart');\"><i class='ui-icon ui-icon-plus ck'></i></span>"
);
};


I am using with this code
Code: [Select]
editor:{type:HucreS}


Areas underlined are parametric

...onclick=\"window.parent.Popuir('../Liste.asp?js=10&l=gssk&e="+rowIndex+"&a=KOD|ADI&v=KOD|ADI',760,540,'Liste');\"><i class='ui-icon ui-icon-search ck'></i></span>...


I want to send data this way, but it doesn't.
Code: [Select]
editor:{type:HucreS('CODE|NAME','AREA1|AREA2')}
« Last Edit: January 19, 2019, 02:38:23 pm by omerix »

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 148
    • View Profile
Re: custom editor parameter
« Reply #1 on: January 19, 2019, 03:54:50 pm »
I used "attr" as a parameter.  :)


Code: [Select]
var HucreS = function (ui) {
var $cell = ui.$cell
,rowData = ui.rowData
,rowIndex=ui.rowIndx
,dataIndx = ui.dataIndx
,width = parseInt(ui.column.width) - 40
,cls = ui.cls
,dc = $.trim(rowData[dataIndx]);
var attr,a,v;
try {attr= JSON.parse('{'+ui.attr+'}');a=attr.a;v=attr.v;} catch(err) {a='';v='';}
console.log('a:'+a);
console.log('v:'+v);
$cell.append("<input type='text'  name='" + dataIndx + "' id='" + dataIndx + "' value='" + dc + "' class='" + cls + " fl ls'  style='z-index: 40000;width:" + width + "px;' autocomplete='off'/>"
+"<span class='ui-widget-header fl ek' onclick=\"window.parent.Popuir('../ModGenel/Liste.asp?js=10&l=gssk&e="+rowIndex+"&a="+a+"&v="+v+"',760,540,'Liste');\"><i class='ui-icon ui-icon-search ck'></i></span>"
+"<span class='ui-widget-header fl ek' onclick=\"window.parent.Popuir('../ModStok/Kart.asp?menu=h&KOD="+dc+"',960,540,'Kart');\"><i class='ui-icon ui-icon-plus ck'></i></span>"
);
};


Code: [Select]
,{title: 'Resim',dataIndx:'RESIM',minWidth:150,dataType:'string',editable:true,hidden:false,editor:{type:HucreS,attr:'"a":"RESIM|ADRES|POPUP","v":"KOD|ADI|BRM1"'} }