Hi,
I’ve just realized that it’s not working too on master… but it works when using navigator edit button.
Thanks,
hi thanks…
Now I know whats wrong…
when I use onclick event and call editGridRow
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
$grid->setNavOptions('edit', array("height"=>"auto","dataheight"=>'auto',"recreateForm"=>true, "closeAfterEdit"=>true)); $grid->setNavOptions('add',array("height"=>"auto","dataheight"=>'auto',"closeAfterEdit"=>true)); $summaryrow = array("NAMA"=>array("MASUK"=>"SUM") ); $grid->navigator = true; $onselrow = <<< ONSELROW function(rowid, selected) { if(rowid && rowid !== lastSelection) { $("#detail").jqGrid('restoreRow', lastSelection); $("#detail").jqGrid('editGridRow', rowid, true); lastSelection = rowid; } } ONSELROW; $grid->setGridEvent('onSelectRow', $onselrow); $grid->renderGrid("#detail","#pgdetail", true, $summaryrow, array((int)$rowid), true,true); |
but when I use navigator edit button.. it will work.
I’m sorry…
I’ve found an example :
http://www.guriddo.net/demo/jqgridphp/editing_data/timepicker/default.php
it works
Thanks
have you fixed this problem ?
Thanks
Ari Adrianto
it’s not working… still 10 rows
I’ve tried to change value… but no luck..
1 2 3 4 5 6 7 8 9 10 11 |
$grid->setAutocomplete("TRUCKING","#TRUCKINGID","select cc.nama || ' | ' || ss.dari || ' | ' || ss.tujuan || ' | ' || ss.tipe || ' | ' || cast (ss.tarif as integer) , cc.nama || ' | ' || ss.dari || ' | ' || ss.tujuan || ' | ' || ss.tipe || ' | ' || cast (ss.tarif as integer) , ss.tarifsupid from customer cc inner join tarif_supplier ss on cc.customerid = ss.customerid where cc.tipe = 'TRUCKING' and ss.status = 'Aktif' and ( cc.nama LIKE upper( ? ) or ss.tujuan LIKE upper( ? )) ORDER BY cc.nama ",array("itemLength"=>50), true, true); |
you can see this….
[/url]
http://postimg.org/image/l3nttsa85/
column “alamat” shift left on spreadsheet filling column “panggilan”, and following by all other column on the right side…
Hi ,
Thanks… it’s working now.
Even a null value in column when export excel, make column shift left.
Hi Tony,
when I can get your updated code ?
has it already available ?
Thanks…
I’m using adodb …
I’m just edit your examples : http://www.guriddo.net/demo/demos/jqgrid/export/true_excel5/default.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
grid.php. <!--?php require_once '../../jq-config.php'; // include the jqGrid Class require_once ABSPATH."php/PHPSuito/jqGrid.php"; // include the driver class require_once ABSPATH."php/PHPSuito/DBdrivers/jqGridPdo.php"; // Connection to the server $conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD); // Tell the db that we use utf-8 $conn->query("SET NAMES utf8");</p> <p>// Create the jqGrid instance<br ?--> $grid = new jqGridRender($conn); // Write the SQL Query $grid->SelectCommand = 'SELECT OrderID, OrderDate, CustomerID, ShipName, Freight FROM orders'; // Set output format to json $grid->dataType = 'json'; // Let the grid create the model $grid->setColModel(); // Set the url from where we obtain the data $grid->setUrl('grid.php'); // Set some grid options $grid->setGridOptions(array( "rowNum"=>10, "rowList"=>array(10,20,30), "sortname"=>"OrderID", "caption"=>"Excel export" )); // Change some property of the field(s) $grid->setColProperty("OrderDate", array( "formatter"=>"date", "formatoptions"=>array("srcformat"=>"Y-m-d H:i:s","newformat"=>"m/d/Y"), "search"=>false ) ); $grid->setColProperty("ShipName", array("label"=>"Shipper Name","width"=>"200")); $grid->setSelect('CustomerID', "SELECT CustomerID, CompanyName FROM customers"); // Enable navigator $grid->navigator = true; // Enable excel export $grid->setNavOptions('navigator', array("excel"=>true,"add"=>false,"edit"=>false,"del"=>false,"view"=>false)); // Set different Excel options (all available) // a PHP excel lib should be preset // Set some grid options $grid->setGridOptions(array("rowNum"=>99999,"rowList"=>array(10,20,30),"sortname"=>"ShipName", "width"=>"1000", "height"=>'300', "footerrow"=>true, "userDataOnFooter"=>true, "grouping"=>true, "shrinkToFit"=>false, "width"=>1000, "groupingView"=>array( "groupField" => array('ShipName'), "groupOrder" => array('asc'), "groupDataSorted" => true, "groupColumnShow" => array(true), "groupText" =>array('<b> ShipName:{0}</b>') ) )); $grid->setExcelOptions(array( "file_type"=>"Excel5", //Excel2007,Excel5,xml "file"=>"report.xls", "start_cell" => "A1", "creator"=>"jqGrid", "author"=>"jqGrid", "title"=>"jqGrid Excel", "subject"=>"Office XLS Document", "description"=>"Document created with Guriddo", "keywords"=>"Guriddo, jqGrid, Excel", "font"=>"Arial", "font_size"=>11, "header_title"=>"Report created with jqGrid", "protect" => false, "password"=>"Guriddo", "path_to_phpexcel_class"=>"External/phpexcel/PHPExcel.php" )); $grid->exportfile = 'Report.xls'; // Enjoy $grid->renderGrid('#grid','#pager',true, null, null, true,true); |
What I mean : when I delete grouping, Export Excel working fine…
But when grouping available… only header appear on excel sheet.
Ohh… sorry… noted…
Thanks
solved…
After debugging your jqGridRender.php , found this :
1 2 3 4 |
// source code deleted due license violation .. |
just put setURL up, after selectCommand and everything would be fine just before setColProperty :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
....... $grid->SelectCommand ='SELECT a.LEMBURID, a.PERIODE, a.KARYAWANID, k.nama, a.JAMLEMBUR, a.JMLSPECIAL, a.JMLDINAS FROM LEMBUR a left join karyawan k on a.karyawanid = k.karyawanid left join divisi d on k.divisi = d.divisiid '; $grid->setUrl('newEntryLembur_.php'); $grid->dataType = 'json'; $grid->setPrimaryKeyId("LEMBURID"); $grid->setColModel(); $grid->table = $table; $grid->setColProperty("LEMBURID", array("label"=>"ID", "hidden"=>true)); ...... |
wow thanks…
it’s strange… looking for this :
http://localhost/test/jqGridRender.php?term=a&acelem=NAMA&oper=autocmpl
should be find : newEntryLembur_.php.
why looking for jqGridRender.php ??
Here’s all my structure file :
jq-config.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
define('ABSPATH', '../'); // Form settings $SERVER_HOST = ""; // the host name $SELF_PATH = ""; // the web path to the project without http $CODE_PATH = "../php/PHPSuito/"; // the physical path to the php files // include the jqGrid Class require_once ABSPATH."php/PHPSuito/jqGrid.php"; require_once ABSPATH."php/PHPSuito/DBdrivers/jqGridAdodb.php"; //require_once ABSPATH."php/PHPSuito/jqGridUtils.php"; require_once ABSPATH."php/PHPSuito/jqAutocomplete.php"; // include the driver class define('ADODB_ASSOC_CASE', 2); require_once ABSPATH."php/PHPSuito/External/adodb5/adodb.inc.php"; require_once ABSPATH."php/PHPSuito/External/adodb5/adodb-exceptions.inc.php"; require_once ABSPATH."php/PHPSuito/External/phpexcel/PHPExcel.php"; try { $conn = ADONewConnection("firebird"); $conn->Connect('localhost',DB_USER,DB_PASSWORD, '/var/lib/firebird/2.5/data/testing.fdb'); } catch (exception $e) { var_dump($e); adodb_backtrace($e->gettrace()); } |
newEntryLembur.php
1 2 3 4 |
.... html stuff include ("newEntryLembur_.php"); |
and newEntryLembur_.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<!--?php require_once '../jq-config.php'; $grid = new jqGridRender($conn); $table = 'LEMBUR'; $grid->SelectCommand ='SELECT a.LEMBURID, a.PERIODE, a.KARYAWANID, k.nama, a.JAMLEMBUR, a.JMLSPECIAL,<br ?--> a.JMLDINAS FROM LEMBUR a left join karyawan k on a.karyawanid = k.karyawanid left join divisi d on k.divisi = d.divisiid '; $grid->dataType = 'json'; $grid->setPrimaryKeyId("LEMBURID"); $grid->setColModel(); $grid->table = $table; $grid->setColProperty("LEMBURID", array("label"=>"ID", "hidden"=>true)); $grid->setColProperty("PRIODE", array("label"=>"Periode")); $grid->setColProperty("KARYAWANID", array("label"=>"KaryawanId")); $grid->setAutocomplete("NAMA","#KARYAWANID","SELECT NAMA, KARYAWANID FROM karyawan WHERE nama LIKE ? ORDER BY nama ",null, true, true); ; $grid->setColProperty("JAMLEMBUR", array("label"=>"Jam Lembur")); $grid->setColProperty("JMLSPECIAL", array("label"=>"Special Day")); $grid->setColProperty("JMLDINAS", array("label"=>"Dinas Luar")); $grid->setGridOptions(array("rowNum"=>99999,"rowList"=>array(10,20,30),"sortname"=>"KARYAWANID", "width"=>"1000")); $grid->toolbarfilter = true; $grid->navigator = true; $grid->setNavOptions('navigator', array("excel"=>true,"add"=>true,"edit"=>true,"del"=>true,"view"=>true)); $grid->setFilterOptions(array("stringResult"=>true)); $grid->setUrl('newEntryLembur_.php'); $grid->renderGrid('#grid','#pager',true, null, null, true,true); |
404 : error always appear when I started typing on search or adding or edit.
All I know is that 404 is URL not found, but which URL ?
I’m only using this 3 files…
Oh No…
what did I missed ?
if i change
1 2 3 |
$grid->setAutocomplete("NAMA","#KARYAWANID","SELECT NAMA, KARYAWANID FROM karyawan WHERE nama LIKE ? ORDER BY nama ",null, true, true); |
with :
$grid->setColProperty(“KARYAWANID”, array(“label”=>”KaryawanId”));
Everything is fine…
Oh No…
what did I missed ?
if i change
<span class="crayon-sy">$</span><span class="crayon-v">grid</span><span class="crayon-o">-></span><span class="crayon-e">setAutocomplete</span><span class="crayon-sy">(</span><span class="crayon-s">"NAMA"</span><span class="crayon-sy">,</span><span class="crayon-s">"#KARYAWANID"</span><span class="crayon-sy">,</span><span class="crayon-s">"SELECT NAMA, KARYAWANID FROM karyawan WHERE nama LIKE ? ORDER BY nama "</span><span class="crayon-sy">,</span><span class="crayon-t">null</span><span class="crayon-sy">,</span> <span class="crayon-t">true</span><span class="crayon-sy">,</span> <span class="crayon-t">true</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span>
Everything is fine…
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top