0
Oops, I have the following code:
// jqGrid //
$grid->('onSelectRow', "fnHistoricoPessoa");
// fim jqGrid//
// função para onSelectRow//
function fnHistoricoPessoa(){
var kwGrid = $("#kwGrid").jqGrid('getGridParam', 'selrow');
if(kwGrid != null)
{
var ret = $("#kwGrid").jqGrid('getRowData',kwGrid);
$("#grid_historico").setGridParam({url:"/admin/pessoas/listagem_historico.json?id_familia=1",page:1});
$("#grid_historico").trigger("reloadGrid");
}
}
With this code I do in jqGrid the option when selecting a line, it fill another grid with the information I want and are: id_familia = 1
only that this 1, I put manual only test the grid, ie it searches in the database the id_familia = 1
and plays on the screen, but I don’t want on every screen to always be the id_familia = 1
, I want you to be the id_familia = id da familia que o usuario está buscando
.
How do I recover the id the user is searching for?
this is a url that has the id of any registered guy: http://localhost:8080/admin/people/members/3984 id_familia = 3984;
– Estácio Di Fabio
You will need to assign the value of an input to a variable and pass this variable through the URL.
– mutlei
i tried it like this: var kwGrid = $("#kwGrid"). jqGrid('getGridParam', 'selrow'); var Ret = $("#kwGrid"). jqGrid('getRowData',kwGrid); $("#grid_historico"). setGridParam({url:"/admin/people/list_historico.json?id_familia="Ret['id_familia']",page :1}); is something like this that you refer to?
– Estácio Di Fabio
It would be something like:
var grid = $("#kwGrid"); var columnInfo = grid.jqGrid('getGridParam', 'selrow'); var ret = grid.jqGrid('getRowData', columnInfo); $("#grid_historico").jqGrid('setGridParam', {url: '/admin/pessoas/listagem_historico.json?id_familia=' + ret['id_familia'], page:1});
– mutlei
Oops, man I tested it here, but it does not return me anything on the grid. I gave an Alert to test in Ret['id_familia'] and it brings the right id.
– Estácio Di Fabio
So what you can do is keep it all in one
String
and make aalert
with her. If theString
appear the way it is expected, send bysetGridParam
.– mutlei
Thanks for your help. I answered my question (:
– Estácio Di Fabio