Author Topic: Render Function  (Read 3592 times)

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 148
    • View Profile
Render Function
« on: November 24, 2013, 03:26:08 am »
Hello,
I want to use the render function, Coll value=undefined

Code: [Select]

   
    var colM = [
        { title: "#",render: function (ui) {
var rowData = ui.rowData;
return ""+rowData[2]+"";
//return "<a Onclick=\"Popup('Ceki_Fason_Giris.asp?cekino="+rowData[1]+"')\"><img src='img/i16/0.png'/>"+rowData[2]+"</a>";
        }},
        { title: "ID", dataIndx: "ID", width: 100 },
        { title: "Ceki No", width: 180, dataIndx: "CEKINO" },
        { title: "Order No", width: 140, dataIndx: "ORDERNO" },
        { title: "Model", width: 140, dataIndx: "MODEL", editor: { type: 'select', options: ['US', "India", "China"]} },
        { title: "Musteri", width: "170", dataIndx: "MUSTERI", editor: { type: 'textarea', attr: "rows=3 cols=40"} },
        { title: "Tarih", width: "170", dataIndx: "TARIH", editor: { type: 'textarea', attr: "rows=3 cols=40"} },
        { title: "Sevk Tarihi", width: "170", dataIndx: "STARIH", editor: { type: 'textarea', attr: "rows=3 cols=40"} }
        ,{ title: "B1", width: 10, dataIndx: "B1",hidden:true}
    ];
« Last Edit: November 24, 2013, 03:29:42 am by omerix »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Render Function
« Reply #1 on: November 24, 2013, 09:20:40 am »
In the first column your dataIndx is an integer inside the render function while in rest of the columns you are using dataIndx as strings.

You have to be consistent, all dataIndx should be either strings or integers and your data should be JSON in first case while array of arrays in 2nd case.

So instead of 2 in rowData[2] you have to put name of field in [] i.e. rowData["ID"] or rowData["CEKINO"]

« Last Edit: November 24, 2013, 09:24:59 am by paramquery »

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 148
    • View Profile
Re: Render Function
« Reply #2 on: November 24, 2013, 03:43:30 pm »
Thank you param  :D