• Diego Lara
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hello,

I'm trying to use the third party javascript library jqgrid (http://www.trirand.com/blog/) for show and filter records with lightning. I have installed the required resources (css/js) and have initialized it in this way:
// component side
<ltng:require styles="/resource/jqui/jquery-ui.min.css"/>
<ltng:require styles="/resource/jqgrid/css/ui.jqgrid.css"/> 
    <ltng:require scripts="/resource/jqgrid/js/jquery-2.2.4.js,/resource/jqgrid/js/i18n/grid.locale-es.js,/resource/jqgrid/src/jquery.jqGrid.js" afterScriptsLoaded="{!c.afterScriptsLoaded}"/>

// Controller side:
({afterScriptsLoaded : function(cmp, evt, helper) {
        $("#jqGrid").jqGrid({                
                viewrecords: true,
                width: 780,
                height: 250,
                rowNum: 20
            });
            // activate the toolbar searching
            
    },

but an exception halts the application when entering the constructor of the jqgrid (afterScriptsLoaded);

The error said: TypeError: this.rows is undefined

"this.rows" its found in the jquery.jqgrid.js and it works fine outside lightning. Any idea of what could be wrong?

Regards