Author Topic: custom editor not getting called  (Read 4803 times)

Ron Hess

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 19
    • View Profile
custom editor not getting called
« on: October 03, 2013, 10:01:37 pm »
This must be super simple, but i'm stuck , I have a custom editor which was working fine in the non-pro version, now just by switching to Pro, this editor is never loaded or called. 

my editor function does not see (not called) when user clicks on the cell, i'm thinking it's a simple config flag that i must include ?

update

i think the editor is no longer a function, but an object with a pointer to a function, will try something like this
 colM.editor = { type:myfunction, style:'', attr: '', cls:'' }

« Last Edit: October 03, 2013, 11:37:55 pm by Ron Hess »

Ron Hess

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: custom editor not getting called
« Reply #1 on: October 04, 2013, 12:26:30 am »

if i pass a function into the object that colModel[].editor expects  { type: myfunction }

I get this from pqgrid

> Uncaught ReferenceError: oper is not defined pqgrid.dev.js:516

the line number is wrong, since it is from a timeout, so
debugged this down to, i think, a cut-paste error in the source code.

On line 3966
if(typeof edtype=="function"){
                inp = edtype.call(that,
                    {
                        $cell: $cell,
                        cellData: cellData,
                        oper: oper,
                        cls: cls,
                        dataIndx: dataIndx
                    }
                );

Note that: oper is not in scope at this time, thus the exception

I don't have a fix yet, will try commenting out this line "oper: oper,"



« Last Edit: October 04, 2013, 06:25:38 pm by paramquery »

Ron Hess

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: custom editor not getting called
« Reply #2 on: October 04, 2013, 08:04:31 pm »
on or about 3965 i am using this code now, appears to work:

if(typeof edtype=="function"){
                inp = edtype.call(that,
                    {
                        $cell: $cell,
                        cellData: cellData,
                        rowData: rowData,
                        colIndx: colIndx,
                        cls: cls,
                        dataIndx: dataIndx
                    }
                );