Welcome Guest, Not a member yet? Register   Sign In
Jqgrid CRUD 1.1[NEW]
#11

[eluser]sihijau[/eluser]
i tried demo and it's great.
#12

[eluser]budi_jati[/eluser]
i found error like this

Fatal error: Call to a member function addField() on a non-object in C:\server\htdocs\crud\system\application\controllers\welcome.php on line 17


i try to change code
$grid = $this->datagrid;
to

$Objgrid =& get_instance();
$grid = $Objgrid->datagrid;

and now, error like this

Fatal error: Call to undefined function json_encode() in C:\server\htdocs\crud\system\application\libraries\Datagrid.php on line 700

any idea?
#13

[eluser]vicman[/eluser]
Maybe u don't have installed the json extension, try to use the json library

http://mike.teczno.com/JSON/JSON.phps
#14

[eluser]budi_jati[/eluser]
Thank you so much.

for install json click here
#15

[eluser]ortenheim[/eluser]
anyone tested this in codeigniter 2.0? i get a blank page when trying it. sometime wrong in the library. usually i see the errors because i use UHOH error library but not here...
#16

[eluser]Blinkiz[/eluser]
Hi there.
Great with a Jqgrid integration! This is something am going to use.

I can see that your source package contains jqGrid 3.6.5. How about new versions of jgrid? Jqgrid 3.8 will have grouping support. A feature a need to use. Maybe datagrid.php is so universal that it does not matter what version of Jqgrid am using?

Great this datagrid.php file. Fantastic work. But I am afraid that this file will get old and not keep up with all the new features of Jqgrid. Can this be the case?
Am kinda new to programming (half year maybe) so I do not understand everything. That is why am asking.
#17

[eluser]Blinkiz[/eluser]
Problem
I believe I have found something that does not work in datagrid.php.
That is formatter.
It exist examples in the file datagrid.php at the beginning and this can be read:
Code:
$grid->label($elements['id']['label'])->validators (array('integer' => "{thousandsSeparator: ' ', defaultValue: '0'}"));
I can not get this to work.


Solution
Instead, I changed in datagrid.php:
Code:
$validators = ',formatter:{';
change that into
$validators = ',formatoptions:{';
Then in my controller/model file, I specified it like this:
Code:
$grid->addField('name');
$grid->label('Namn')->validators (array('baseLinkUrl' => "'customers/get'", 'idName' => "'id'"));
$grid->params(array('editable' => "'false'",'formatter' => "'showlink'"));
I need to specify stuff with triple quote. That should probably also be fixed.

This is the first time using Jgrid and this codeigniter integration, so I can have understood things wrong. But this will get formatter to work.


Codeigniter URI style and Jqgrid
As a side note, to get showlink formatter to work, I needed to get Jqgrid to work with codeigniter route URI style.
file /js/lib/jquery.jqGrid/jquery.jqGrid.min.js
Code:
;d=d.baseLinkUrl+d.showAction+"?"+d.idName+"="+b.rowId+d.addParam;
change that into
;d=d.baseLinkUrl+d.showAction+"/"+b.rowId+d.addParam;
#18

[eluser]Blinkiz[/eluser]
Problem
When creating multiply Jqgrid on one page, it gets the same ID number generated.
Code:
$this->load->library('datagrid','','datagrid1');
$grid  = $this->datagrid1;
$this->load->library('datagrid','','datagrid2');
$grid2  = $this->datagrid2;


Solution 1
In file datagrid.php, change this in the constructor
Code:
$this->_gridname = '_' . time();
into
$this->_gridname = '_' . rand();


Solution 2
Use setgridName().
Like this in your controller/model:
Code:
$grid->setgridName('mygridname');
This will make it unique.
#19

[eluser]vicman[/eluser]
Code:
New version 1.1
Now we can export our result like pdf, csv,xml
jqgrid 3.7.2
DEMO
#20

[eluser]Blinkiz[/eluser]
Thanks vicman for another release. Great, love it!




Theme © iAndrew 2016 - Forum software by © MyBB