Hello,
We have send you e-mail.
Kind Regards,
Will
Guriddo Support Team
Hello Ken,
Thank you very much to point us of this problem.
We have found it and fixed it. It will be available in the next release.
If this is a showstopper, please let us know we will send you the fix.
Kind Regards,
Will
Guriddo Support Team
Hello,
Yes, there is a way to get the last inserted id, but only when the insert is done.
At the moment to do what you want some trick should be applied.
One possible way is to disable automatic add and at certain point of the code and perform some other operations
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
$grid->setTable('main_table'); // set the primary(uniquie) key $grid->setPrimaryKeyId('OrderID'); if($grid->oper == 'add') { // obtain the data posted from the client $data = filter_input_array(INPUT_POST); // try to insert the data in the table if( $grid->insert($data) ) { $LastInsert = $grid->getLastInsertId(); if($LastInsert) { $grid->setTable('child_table'); $grid->setPrimaryKeyId('OtherKey'); $grid->serialKey = false; $grid->insert( array( "OtherKey"=>$LastInsert, .....) ); } } } $grid->add = false; |
Note setTable before if and $grid->add = false after the if.
You can do a lot variations using this approach.
In the upcoming release we will add a special word in which the last inserted id can be used in setAfterCrud (thank you for point us to add this feature)
Kind Regards
Will
Guriddo Support Team
Hello,
To overcome such problems you can set PDO to use lower case or upper case.
By example if you do :
|
1 2 3 4 |
// Connection to the server $conn = new PDO(DB_DSN."tinicum",DB_USER,DB_PASSWORD); // Set the case in which to return column_names. $conn->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); |
then no mater how you write your column names, but this depend on the needs and should be used with care.
Kind Regards,
Will
Guriddo Support Team
Hello,
It is not a bug. We just fix some not wanted behavior of the search property in colModel for this method
To continue use the search on all fields set searchAll option to true in the method.
|
1 |
... $("#jqGrid").jqGrid('filterInput', self.value, {searchAll: true}); ... |
We have fixed our code in the demo too.
We understand that this will maybe break other users and have revert the change back. This will be available in the upcoming 5.8.2 release.
Kind Regards,
Will
Guriddo Support Team
Hello,
It seems to me that you have a typo: In the select command you have
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
$grid2->SelectCommand = " select lo.LandownerID, lo.LandOwner, lo.LandOwnerNotes, ls.Status, case when lm.LastName = 'UNASSIGNED' then 'UNASSIGNED' else concat(lm.FirstName, ' ', lm.LastName) end CurrentlyAssignedTo, lo.LandOwnerAddress1, lo.LandOwnerAddress2, lo.LandOwnerCity, lo.LandOwnerState, lo.LandOwnerZip, lo.HowToContact, lo.MailingSalutation, lo.AddressedTo from tblLandOwners lo, tblLpcMembers lm, tblLandOwnerStatus ls where lo.CurrentlyAssignedTo = lm.LpcMemberID and lo.Status = ls.StatusID"; // Set output format to json |
but in the set primary Key you do
|
1 2 3 |
... $grid2->setPrimaryKeyID('LandOwnerID'); .. |
Try to set it like this:
|
1 2 3 |
.. $grid2->setPrimaryKeyID('LandownerID'); ... |
Edit: Just in case you can force the primary key in script using the key=>true feature in colMode
|
1 2 3 |
... $grid2->setColProperty("LandownerID", array("key"=>true, "editable"=>false,"hidden"=>false)); ... |
Kind Regards,
Will
Guriddo Support Team
Hello,
Everthing what you do is correct except that you use Bootstrap CSS Framework.
As per definition of this CSS the disabled class is named ui-diabled see the CSS object class in jqGrid definition, while the ui-state-disabled is for jQuery UI CSS. To have cross working booth class is recommended to be set
You code work if you do:
|
1 2 3 4 5 6 7 |
rowattr: function (rd) { if (rd.Errori>0) { return { "class": "ui-disabled ui-state-disabled ui-jqgrid-disablePointerEvents" }; } }, |
Kind Regards,
Will
Guriddo Support Team
Hello Kris,
We apologize for the late answer.
We where able to create a experimental function comboGrid (all changes are in github) in which we implement some of your requested features.
Here is the demo – the combo grid is bound to ShipName edit field and for the demo purpose it returns the country name.
The function has 3 parameters – the input element; options which contain data parameter (can be a string or array) and return field – a field which should be returned when the user press enter or select with a click; the third parameter is a grid object parameter with colModel and etc.
There are some small problems, but I hope this will help you and other to use the grid as combo.
Please let us know if you have any recommendations, improvements or anything what you think it will be helpfully.
Kind Regards,
WIll
P.S. All the changes are in GitHub.
Guriddo Support Team
Hello Kris,
Thank you for the recommendation. We will see what we can do within this week.
There is already similar solution here
Having this code we can maybe reconstruct the it to be used as combo grid like in the demo shown from you.
Thank you very much again.
Kind Regards
Will
Guriddo Support Team
Hello,
I have simulated some long text in order to show you the solution.
Here is the demo code
Kind Regards,
Will
Guriddo Support Team
Hello,
The solution you requested require to add html content to your data.
This is tested and works as per your requirement:
Add the following style definition:
|
1 2 3 4 5 6 7 8 9 10 |
<style> .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { white-space: normal !important; height: auto; } .mylongdata { height:90px; overflow-y:auto; } </style> |
after the jqgrid css.
Your long data when comes from the server or local array enclose in div tag with class mylongdata
so it look like:
|
1 |
<div class='mylongdata'>...your data here ...</div> |
You can adjust your height in mylongdata depending on your needs.
or simple use cell formatter to analyse its length and enclose it in that div with the class
If you have difficulties with using cell formatter, please let us know.
Kind Regards,
Will
Guriddo Support Team
Hello Kris,
I think that the simplest way is to create your own function with parameters – the grid id and pager id and the conditionally add the needed buttons.
Something like this:
|
1 2 3 4 5 6 7 8 9 10 |
function myButtons( grid, pager, myparams) { if(myparams.excel) { // here navButtonAdd $(grid).jqGrid('navButtonAdd', pager, {/*here code to add excel*/} } if(myparams.pdf) { // similar code here } .... } |
and then call this function after the navigator
If you have maybe better idea, please let us know.
Kind Regards,
Will
Guriddo Support Team
Hello,
From what I understand you missed a grid parameter called autowidth – this parameter initially set the grid width to its parent.
Unfortunately we do not have a similar parameter for the height (we will try to create this in next release) which means that we need to write small code to fith the grid height to its parent. In the example provided we use onInitGrid event and setGridHeight method with second parameter set to true.
To have toppager only this is a little tricky – set toppager in grid parameter to true, disable creation of grid pager – the last param in renderGrid and then use cloneToTop set to true in navigator.
The whole example is here
If something is not clear, please do not hesitate to ask us.
Kind Regards,
Will
Guriddo Support Team
Hello,
In order to help you we need your code and html page where the grid renders.With other words – if you send us a demo demonstrating the problem, that would solve the problem in 80%.
Thank you
Kind Regards,
Will
Guriddo Support Team
Hello,
You can use dataEvents property in colModel editoptions. Here is possible to add any event supported by element.
For more information see here editoptions properties
If you have dificulties, please let us know.
Guriddo Support Team
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top