Author Topic: Render Function - not executing when defined as a string  (Read 722 times)

Webauthor

  • Pro OEM
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Render Function - not executing when defined as a string
« on: August 12, 2022, 07:22:28 pm »
Hello,

Since very 8.4, render functions defined as a string (to point to an external function) are no longer working.

You can see in this fiddle showing 8.3.  A simple function is defined "renderCell" and specified in the render attribute of the first column in colModel - Rank.
https://jsfiddle.net/webauthor/c30seLq8/6/

When switching the library to 8.5, we're getting the error below:
https://jsfiddle.net/webauthor/65myvwop/

ERROR:
"jQuery.Deferred exception: t.call is not a function", "TypeError: t.call is not a function
    at t.callFn (https://support.webauthor.com/lib/pqgrid/8.5/pqgrid.min.js?ver=20210813-A:9:121172)
    at pq.cRenderSum.renderCell (https://support.webauthor.com/lib/pqgrid/8.5/pqgrid.min.js?ver=20210813-A:9:93605)
    at pq.cRenderSum.generateCell (https://support.webauthor.com/lib/pqgrid/8.5/pqgrid.min.js?ver=20210813-A:9:369570)
    at pq.cRenderSum.renderRow (https://support.webauthor.com/lib/pqgrid/8.5/pqgrid.min.js?ver=20210813-A:9:378141)
    at pq.cRenderSum.renderView (https://support.webauthor.com/lib/pqgrid/8.5/pqgrid.min.js?ver=20210813-A:9:378408)
    at pq.cRenderSum.refresh (https://support.webauthor.com/lib/pqgrid/8.5/pqgrid.min.js?ver=20210813-A:9:375809)
    at pq.cRenderSum.refreshAllCells (https://support.webauthor.com/lib/pqgrid/8.5/pqgrid.min.js?ver=20210813-A:9:376507)
    at pq.cRenderSum.initPost (https://support.webauthor.com/lib/pqgrid/8.5/pqgrid.min.js?ver=20210813-A:9:390322)
    at pq.cRenderBody.init (https://support.webauthor.com/lib/pqgrid/8.5/pqgrid.min.js?ver=20210813-A:9:383204)
    at v.paramquery.cRefresh.refresh (https://support.webauthor.com/lib/pqgrid/8.5/pqgrid.min.js?ver=20210813-A:9:113125)", undefined

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Render Function - not executing when defined as a string
« Reply #1 on: August 15, 2022, 03:51:26 pm »
Please use this patch for now, it can be included just after loading pqgrid js file.

Code: [Select]
$.paramquery.pqGrid.prototype.callFn = function(cb, ui){
return pq.getFn(cb).call(this, ui);
};

Webauthor

  • Pro OEM
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Re: Render Function - not executing when defined as a string
« Reply #2 on: August 15, 2022, 06:06:29 pm »
Thank you so much.  Works great.