php - SlickGrid error: Slick.Editors.Text is not a constructor -
i'm trying implement slickgrid on edit page of cakephp project, , when page loads error in javascript console:
slick.grid.js:2173typeerror:'slick.editors.text not constructor' (evaluating 'new (editor || geteditor(activerow, activecell))') the data renders correctly in grid on page, when click on cell edit it, turns white , can't type anything. if click on cell, cell turn white , first 1 stay white.
here php/jquery code:
<?php echo $this->html->script("/js/slickgrid/lib/jquery-1.7.min.js"); ?> <?php echo $this->html->script("/js/slickgrid/lib/jquery.event.drag-2.0.min.js"); ?> <?php echo $this->html->script("/js/slickgrid/lib/jquery-ui-1.8.16.custom.min.js"); ?> <?php echo $this->html->script("/js/slickgrid/slick.core.js"); ?> <?php echo $this->html->script("/js/slickgrid/slick.grid.js"); ?> <?php echo $this->html->script("/js/slickgrid/slick.editors.js"); ?> <?php echo $this->html->script("/js/slickgrid/slick.formatters.js"); ?> <?php echo $this->html->script("/js/slickgrid/slick.dataview.js"); ?> <?php echo $this->html->script("/js/slickgrid/plugins/slick.cellselectionmodel.js"); ?> <?php echo $this->html->script("/js/slickgrid/plugins/slick.cellrangedecorator.js"); ?> <?php echo $this->html->script("/js/slickgrid/plugins/slick.cellrangeselector.js"); ?> <?php echo $this->html->script("/js/slickgrid/plugins/slick.rowselectionmodel.js"); ?> <?php // setup rows , cols array grid $columns = array(); foreach($route['stop'] $stop) { $columns[] = array( "name" => $stop['name'], "field" => $stop['id'], "id" => $stop['id'], "editor" => "slick.editors.text"); } $tripid = 1; $thistrip['id'] = $tripid; foreach($route['routetrip'] $routetrip) { if($routetrip['trip_id'] != $tripid) { $rows[] = $thistrip; $tripid = $routetrip['trip_id']; $thistrip['id'] = $tripid; } else { $thistrip[$routetrip['stop_id']] = $routetrip['time']; } } ?> <?php echo $this->html->scriptblock(' var rows = '.json_encode($rows).'; var columns = '.json_encode($columns).'; var options = { rowheight:21, defaultcolumnwidth:100, editable:true, enableaddrow:true, enablecellnavigation:true, asynceditorloading:false, autoheight:true, autoedit:true }; slickgrid = new slick.grid($("#scheduletable"), rows, columns, options); slickgrid.setselectionmodel(new slick.cellselectionmodel()); slickgrid.updaterowcount(); slickgrid.render(); '); ?> the $rows , $columns correctly formatted, , each column has "editor" attribute "slick.editors.text" value.
help?
i have got error when started working slickgrid.
the error because have specified editor string , not class. so, remove double quotes in "editor" => "slick.editors.text" , give "editor" => slick.editors.text
this solved error me. hope solution solve yours too.
Comments
Post a Comment