Hello,
One possible solution is to use subGridBeforeExpand event.
The event raises before expanding the new row.
The code can be something like this – use grid options:
|
1 2 3 4 5 6 7 8 9 10 |
.... subGridBeforeExpand: function(divid, rowid) { // #grid is the id of the grid var expanded = jQuery("td.sgexpanded", "#grid")[0]; if(expanded) { setTimeout(function(){ $(expanded).trigger("click"); }, 100); }, ... |
Kind Regards
Hello,
I have fixed the problem and have prepared the demo.
You can look it here
If you want to use the fixed version you can download it. See the links in the code tabs.
Please let me know if this fixes for the problem.
Kind Regards
Hello,
I have found a little bug while preparing the example. I will fix them and make the needed, so that you can use the inline editing in this case without problems.
Thanks for finding this issue.
Kind Regards
Hello,
To be a honest I do not have tested this.
So my question is:
Which editing module do you use?
Form edit, inline edit or cell edit?
Every such module has its own serialize function.
I will check this and will try to prepare a example, since this is a basic question.
Kind Regards
Hello,
The documentation explain it very goog. JavaScript does not understand numbers with decimal separators. Such numbers are treated as string. That is the reason that we display in grid the number with decimal separator as comma, but when edit it the predefined formatter convert it to a way that it can be understand for JavaScript.
In order to solve your problem you will need to use custom formatter and unformat function and then use serializeRowData to convert back the number to a valid number, since your database understand numbers with decimal separator as point.
Below is the code:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<script> jQuery("#grid_id").jqGrid({ ... colModel: [ ... {name:'price', index:'price', width:60, align:"center", editable: true, formatter:numFormat, unformat:numUnformat}, ... ], // this for inline edit searializeRowData: function( row ) { row.price = row.price.replace(",","."); return row; }, ... }); function numFormat( cellvalue, options, rowObject ){ return cellvalue.replace(".",","); } function numUnformat( cellvalue, options, rowObject ){ return cellvalue; } </script> |
Hope this helpls
Kind Regards
Hello,
I think that if your adding in database is ok, then the reason for this is tha initially your grid is sorted in some way and after adding the record , the grid is reloaded and your record is not visible. reloadAfterSubmit set to false will solve the problem.
Another way with reloading the grid is to use appropriate sorting fields, so that the record can be visible after adding.
Kind Regards
Hello,
Curently we do not support multiple primary keys when updating the table.
You can solve the problem in two ways:
1 You will need to update your table to have a primary key.
Just add a auto increment field in your detail table and the problem will be resolved.
2. You can get the posted data when the operation is update and manually build your query.
The code snip let can look like this:
|
1 2 3 4 5 6 7 8 |
if($grid->oper == "edit") { // get your data here $data = $_POST // This is not save and is used as example // build your own query here .... // disable the automatic grid update $grid->edit = false } |
Kind Regards
Hello,
To create a textarea for that you use the setColProperty as follows:
|
1 |
$grid->setColProperty("notes", array("label"=>'Notes',"edittype"=>'textarea',"editoptions"=>array("rows"=>10,"cols"=>40))); |
edittype = texarea and you use the editoptions to define the size of the text area…
If you want only to view the field you can set it as readonly.
The final code can look like this
|
1 |
$grid->setColProperty("notes", array("label"=>'Notes',"edittype"=>'textarea',"editoptions"=>array("rows"=>10,"cols"=>40, "readonly"=>true))); |
Hello,
In case of dynamic lists I think that this is a good implementation.
Thanks for sharing
Kind Regards
Hello,
The problem is that ajaxRowOptions belongs to the grid options, while the ajaxDelOptions belongs to the navigator (or delGridRow) method and this should be passed to the method.
Hell,
Yes we plan to add this next week.
Kind Regards
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top