[EXTENSIONS] jqGrid

http://www.yiiframew…tension/jqgrid/

Please try it :)

Hi, really like the extension, very useful! One thing I’m having trouble with though, is gettting the search toolbar to show above the columns when i click the search button. There is a demo of what i want to acheive at http://trirand.com/jqgrid/jqgrid.html, the example is called “Multiple Toolbar Search” which can be found on the “New in version 3.3” submenu.  Have you managed to get this feature working?

Hello, first of all, sorry for my English, I don't speak very well.

I'm new to yii, php and javascript.

I tried your extension and it worked well, I used it with an action that returned json data, all perfect, the thing that I could not make to work is the find, it triggers nothing, as if no action is taking place.

Maybe you have some samples to post here so we can investigate and learn how to use it, maybe for editing and other stuff.

Well… sorry again for my english and very kind of you for sharing your extension!

Do you have an example on how to configure a function to respond to any of the callbacks (onXXX)?  I have tried to define an 'onselectRow' function within the 'options' array and also as a 'callbacks'.  The options approach shows the function in the HTML within the jqGrid parameters, but it does not seem to define the function for that event.  I defined the item as

array(

  'name'=>'jqgrid1',

  …

  'options'=>array(

      …

      'onselectRow'=>"function(ids) { alert(ids);}"

  )

I also tried:

array(

  'name'=>'jqgrid1',

  'callbacks'=>array('onselectRow'=>"function(ids) { alert(ids);}");

  …

  'options'=>array(

      …

  )

After some additional investigation, I found that the EJqGrid.php makeOptions function is building the encodedOptions  for the onselectRow property as -

'onselectRow':'function () {alert();}'

It needs to be without single quotes around the function definition -

'onselectRow':function () {alert();}

May need a new CJavaScript::encode function that looks for the onXXX properties and suppresses adding the quotes.

OK, found the right way.  Precede the word function with js: and the encode method will not enclose it with quotes.

'onselectRow':'js:function () {alert();}'

Hope this helps other newbies!

Craig

Greeting!

may i know how to call the jqgrid search function??



<input type="BUTTON" id="bsdata" value="Search" /> 




<script type="text/javascript">





jQuery(document).ready(function() {


$("#bsdata").click(function(){ $("#test_grid_grid").searchGrid( {sopt:['cn','bw','eq','ne','lt','gt','ew']} ); 


}); 


});





</script>





but i click the button it is no response  ???

BUG report:

when in config file eg: protected/config/main.php set different langs - widget doesnot work

In my case

‘sourceLanguage’=>‘en’,

‘language’=>‘ru’,

It happend becouse trying download return 404 on /i18n/grid.locale-ru.js and all other langs differnet with EN or ES

i enhanced this extension~

http://www.yiiframework.com/extension/jqgrid/reviews/#c835

Hello,

I want to get data from selected row.

I saw the example in http://www.trirand.com/blog/jqgrid/jqgrid.html#, but i cannot reproduce it.

My code is:

<?php




 

$this->widget('application.extensions.jqgrid.EJqGrid', 

              array(

                    'name'=>'list',

                    'compression'=>'none',

                    'theme'=>'redmond',

                    'useNavBar'=>true,

                    

                    'options'=>array(

                    				 'datatype'=>'json',

                                     'url'=>'http://127.0.0.1/DocMan/index.php?r=/site/example',

                                     'colNames'=>array('Id','Tip dosar','Nr. registru','Data registru','Data scandeta','Observatii'),

                                     'colModel'=>array(

                                                       array('name'=>'Id','index'=>'id','width'=>30),

                                                       array('name'=>'Tip dosar','index'=>'tip_dosar','width'=>100),

                                                       array('name'=>'Nr. registru','index'=>'nr_registru','width'=>70),

                                                       array('name'=>'Data registru','index'=>'data_registru','width'=>120),

                                                       array('name'=>'Data scandeta','index'=>'data_scadenta','width'=>120),

                                                       array('name'=>'Observatii','index'=>'observatii','width'=>100,'sortable'=>'false'),

                                                      ),

                                     'rowNum'=>10,

                                     'rowList'=>array(10,20,30),

                                     'sortname'=>'Id',

                                     'viewrecords'=>true,

                                     'sortorder'=>'desc',

                                     'search'=>true,

									 'width'=>'710',	                

                                     'caption'=>'Agenda '.date("d.m.Y"),

                                     'height'=>'500',

                                     'page'=>1

                                    )

                   )

             );


?>




Great works… i stacked for the same.

Thanks a Lot

Hi all !!

I create a function to return to grid a ‘datatype’=>‘local’ :


  public function actionGridArray()

  {

      $sql = 'select "id","name","comment" from "MyTables";';


      $req = Yii::app()->db->createCommand($sql);

      $children = $req->queryAll();

      echo json_encode($children);

  }

this function return an array like :

[{"id":1,"name":"dxf","comment":""},{"id":3,"name":"jbk","comment":""}]

which seems to look good for a datatype "local" I think

here is my grid widget :


$this->widget('application.extensions.jqgrid.EJqGrid', 

              array(

                    'name'=>'jqgrid1',

                    'compression'=>'none',

                    'theme'=>'redmond',

                    'useNavBar'=>true,

                    'useNavBar'=>'false',

                    'options'=>array(

                                     'datatype'=>'local',

                                     'url'=>$this->createUrl('gridArray'),

                                     'colNames'=>array('Index','name','comment'),

                                     'colModel'=>array(

                                                       array('name'=>'id','index'=>'id','width'=>55),

                                                       array('name'=>'name','index'=>'name','width'=>90),

                                                       array('name'=>'comment','index'=>'comment','width'=>100)

                                                      ),

                                     'rowNum'=>10,

                                     'rowList'=>array(10,20,30),

                                     'sortname'=>'id',

                                     'viewrecords'=>true,

                                     'sortorder'=>"desc",

                                     'caption'=>"Airplanes from XML"

                                    )

                   )

             );

Though all of that, Nothings is shown in the grid and I can’t see where there si something wrong… can you help me ?

thankss