Hello,
sorry, i have now a new question.
How i can add some datas to the postdate, if i use inline-edit?
I test now with a lot of features, but nothing work… i think i put it in the wrong section.
Here is my code. Start in the Colmodel… i have there 3 Buttons in each row… subgrid-button, edit-button and delete-button. I use navigator-bar on the bottom too!
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
colModel:[ {name:'myac',index:'', width:80, fixed:true, sortable:false, resize:false, formatter:'actions', formatoptions: { keys: true, delOptions:{recreateForm: true, beforeShowForm:beforeDeleteCallback}, editoptions:{beforeShowForm:beforeEditCallback, dataEvents: [{ type: 'click', fn: function(e) { alert("in click submit"); } }] } }, }, |
the reason is why i need add some datas to postdate,
i add in some custom-select-option-tags any id’s in the data-attribut
like this
|
1 2 3 4 |
select id="1_containerTypeName" class="editable" role="select" name="containerTypeName"> <option value="20" data-containertypeid="4" data-typeid="2" data-gtype="L.F.N">V-Container Nr. 5</option> <option value="21" data-containertypeid="3" data-typeid="4" data-gtype="M.A.F">Active Container Nr. 6</option> </select> |
if i edit the row or i do other actions, then i get only the values…
can anybody help me?
best regards
achim
hello
i change my json-array from
array( $row[‘tableSectionId’], …..
to
array( “tableSectionId” => $row[‘tableSectionId’], …..
now work my rowObject with key-names
best regards
Achim
sorry
i have one important question more.
I can not call the rowObject with the key-names… i have to call the rowObject only with the numbers of the array
i get my grid-data in json-array from a mysql-call.
the getdata.php create the json-object like this
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)) { $responce->rows[$i]['id']=$row['tableSectionId']; $responce->rows[$i]['cell']=array( $row['tableSectionId'], $row['tableSectionName'], $row['roomNr'], $row['roomType'], $row['nlContainerTypeName'], $row['gType'], $row['tableLength'], $row['tableWidth'], $row['containerNr']); $i++; } echo json_encode($responce); |
my json-array what i get in my grid looks like this
{"page":"1","total":1,"records":"2","rows":[{"id":"1","cell":["1","Test1","1","via","Vorhalte-Container","LFS","0.00","0.00","2"]},{"id":"3","cell":["3","Test2","1","via","Vorhalte- Container","LFA","120.00","50.00","2"]}]}
if i ask now the rowObject in my js-jqgrid-section like that
var mytest= rowObject['roomNr'];
then i get undefined
if i ask
var mytest= rowObject['2'];
then i get the data…
i think, i do it wrong to create the json-object.
how i have to create this json-object to get there the key-names?
best regards
Achim
Hello,
this works now for me
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
dataEvents: [{ type: 'change', fn: function(e) { var selected = $(this).find('option:selected'); var selectedRowId = $(grid_selector).jqGrid ('getGridParam', 'selrow'); var extra = selected.data('type'); $('input#roomType').val(extra); var roomId = selected.val(); $.ajax({ url: "incl/getData/getNlContainerTypeName.php?func=getContainerByRoom&Id="+roomId, async: false, type: "GET", dataType: "html", success: function(ergebnis){ } }).done(function (data) { $("select[name='nlContainerTypeName']").empty(); $("select[name='nlContainerTypeName']").append(data); }); } }]}}, |
Hello,
i would like add a button in the detail content.
I add now a custom-button in this detail content.
With this reload-custom-buttom i call now the ajax-function to reload this detail-content.
This works now… i am not sure if is the right way to do this. But this works
best regards
Achim
i solved the problem with
image-1-2.jpg?time=unixtimestamp
I have one question more please:
i use custum Detail subgid
like this function
subGridRowExpanded: showChildGrid,
|
1 2 3 4 5 6 7 8 9 10 11 12 |
function showChildGrid(parentRowID, parentRowKey) { $.ajax({ url: "incl/getData/getInfoData.php?id="+parentRowKey+"&func=details&table=info", type: "POST", width: "600", success: function (html) { $("#" + parentRowID).append(html); } }); } |
1) How i can add there a reload-button
Best regards
Achim
Hello
wow, thanks a lot.
so easy it can be.
Thanks
Best regards
Achim
Hello,
yes, i know the cellattr event and i use this. But with my json-data don’t work keynames in tooltips. I get only “undefined”
look please my code
|
1 2 3 4 5 |
{name:'containerNr',index:'containerNr',align: "center", width:60, sorttype:"text", edittype:"select", editable: true, editoptions:{dataUrl:'incl/getNlContainerTypeName.php?func=Nr'}, cellattr: function (rowId, val, rawObject, cm, rdata) { return 'title="<?=_("Container Nr. ");?>' + rawObject.containerNr + ' <?=_("in room");?> ' + rawObject.roomNr + '" class="my-tooltip-test tooltip-info" data-rel="tooltip"'; |
i get this output
“Container Nr. undefined in Room undefined”
if i use
rawObject[12] or other key-numbers from my rawobject-data-array then works, but this is not clear to read in my code if i have to use this way.
best regards and many thanks for help
Achim
}},
Hello,
i found setInterval. Thats enough for me.
i can reload with interval the hole grid.
Bevor i looking for interval reload only for a cell, but this way with setInterval is also ok.
One Question:
i get my data in json-format.
i was looking for set custom-tooltip.
normal i see in the docs i can use rowObject. but if i use json-data then i don’t get the key-names of the array.
i get only
rowObject[12] and not rowObject[‘mykeyname’].
if there any way to get the rowobjekt with key-names if i use json-data ?
best regards
Achim
sorry,
i found the solution
thanks
best regards
Achim
hello,
thanks a lot. I found it already.
Now i can work with jqgrid better and better…
sorry all, for my lot questions
One little question more please.
If is possible to put a function in a colModel with that features ===>
– if i show a grid-table, and i don’t reloaded then i would like see maybe all 5 minutes a update for this one ColModel Cell.
i have a database, they get all few minutes new data from temp-sensors, and i would like ask this table about new values, but only for this one cell in my colModel
best regards
Achim
Hello
i added now this jquery code, this works.
But i don’t know if this the right way to do this.
please ´look.
//add in each row the data-tag “data-group” and add to data-group the groupid “row[‘data-group’]”
|
1 2 3 4 5 6 |
loadComplete : function(data) { data.rows.forEach( function ( row, i ) { var z = i + 1; jQuery(grid_selector).find('tr').eq(z).attr('data-group', row['data-group']); }); }, |
if i expand the subgrgrid then i need the groupid with this way
|
1 2 3 4 5 6 7 8 |
subGridRowExpanded: function (subgridDivId, rowId) { var dataGroup = $("#"+rowId).data('group'); // now i get in dataGroup the groupid . . . . |
best regards
Achim
now i tested with this sample
|
1 2 3 4 5 6 |
$(grid_selector).on('jqGridLoadComplete', function ( data ) { var $this = $(this); data.rows.forEach( function ( row, i ) { $this.find('tr').eq(i).data('group', row['data-group']); }); }); |
i will describe new my problem.
1) i would like add a data-attribute in each row “data-group”
2) i would like add to this data-group attribute a groupid, this i groupid i get it from json-string, the key-name there is also data-group,
3) if i klick to the expand butto to show my subgrid i would like get the groupid from my data-group-attribute
sorry, mysqlf and others ( i ask other programmers too) dont’t find any way in the jqgrid-docu to add any user data-attributes with values of any key as the josn-string to the row in the tables…
we read a lot but we don’t find it… sorry
please give any help
Thanks
best regards
achim
sorry
i describe wrong the problem
i mean this way
$grid->setGridEvent(‘loadComplete’, $load);
i think that is the way to call a javascript function written in php-Herodec or?
my problem is to understand some ways to put the Events in some php-statements
like $grid->setGridEvent or $grid->setNavEvent
best regards
Achim
ok now i found the way to set hidden
i set now in my colmodel.
i thought it’s enough to set in the $param-array of setColModel, but i have to set in the $models-array
$grid->setColModel($model, $params,$labels );
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top