it works!! thank you!
ok,
thank you
Hello,
it works thank you.
But is it normal that to access the element I have to do elem[0] and not elem?
I have prepared a demo here, just click edit on the 1st row and you see (in the console) that elem is empty.
Hello,
I have 2 questions:
edit:
problem 2 is solved if i change this:
.ui-jqgrid-btable tbody tr.table-success.table-active > td
{
/*background-color: rgba(0, 0, 0, 0.075) !important;*/
background-color: rgba(0, 0, 0, 0.075);
}
could you tell me if you will do these changes too?
Hello,
it’s quite simple:
.rowGray {
background-color: gray !important;
color:white;
}
Hello, I use this:
cellattr: function (rowId, val, rawObject, cm, rdata) {
if(val==”A”){
return ” class=’rowGray'”;
};
}
Hello,
thank you very much, it works.
I just don’t like very much the “flickering” when it closes and reopen, it would be nice to avoid it.
Hello, I will try to create a demo too
Hello,
I’m using jqgrid 5.5.5, bootstrap v.4.5.0, jquery 3.6.0
all setups are standard, nothing customized.
thank you!
I created a jsfiddle.
in this test I would like to have name, id, button but keep the subgrid in the beginning:
https://jsfiddle.net/lorife/dusqww2w/
consider that if I set:
subGrid: false
it works
I will try to create a working demo.
as it will take some time, I wanted to let you know the problem because maybe you already knew something about it considering the changes from 5.5.1 to 5.5.2
I will let you know.
thank you,
Lorenzo
Hello,
do you have any news regarding autosize when the name of the column is longer than it’s content?
It’s so ugly to see all column names truncated.
Thank you!
Lorenzo
Hello,
I understand.
I tried to create a jsfiddle but how can I simulate an ajax call as in “select 2 function” – row 9 ? I lost an hour trying to do it but it does not work.
Sorry for not saying it but I’m using last version of everything. So last available version of jqgrid and select2.
If you want a can create a demo and send it do you then you can adapt it.
Lorenzo
Hello,
I tried to put it on jsfiddle but it’s not working. I don’t know how to make that kind of ajax call.
I will try to write the code here hoping you can simulate it.
MAIN JAVASCRIPT:
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 |
{name:'IdTipoCollo', index:'IdTipoCollo', width:400, editable:true, hidden: true, edittype:'select', editrules:{edithidden: true}, editoptions:{ dataUrl:'lista_combobox/lista_tipi_colli_std.php', postData: function (rowid) { // Prendo i dati della spedizione var cl = jQuery('#gMain').jqGrid('getGridParam','selrow'); var dati_testata = jQuery("#gMain").jqGrid('getRowData', cl); return { action: "getState", AutoSelect: "0" } }, dataInit: function(element) { CaricaSelect2(true, element, "lista_combobox/lista_tipi_colli_std.php?TipoOutput=1&AutoSelect=0", i18next.t('generic.search_dots'), [], 0, false, true); }, dataEvents: [ {type: 'change', fn: function (e) { // Editvalue e Keyvalue var TestoSel = $(this).find('option:selected').text(); var IdSel = $(this).children(":selected").attr("value"); var ExtraData = $(this).select2('data')[0]; if(ExtraData){ vLev = ExtraData.level; } } } ] }, searchoptions:{clearSearch:false} }, |
SELECT2 FUNCTION
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 |
$(IDCombo).select2({ theme: "bootstrap4", allowClear: bAllowClear, dropdownAutoWidth : true, minimumInputLength: vMinLength, width: '100%', placeholder: vSearchText, ajax: { url: vUrl, dataType: 'json', delay: 250, data: function (params) { return { q: params.term, page: params.page || 1, doPages: bDoPages }; }, processResults: function (data, params) { params.page = params.page || 1; return { results: data, pagination: { more: false } }; }, cache: true } }); |
PHP:
1 2 3 4 5 6 7 8 9 10 11 |
while($result = $stmt->fetch()){ $return_arr[] = [ 'id' => $result['IdFiliale'], 'text' => $result['Descrizione'], 'level' => $result['level'] ]; $i++; }; echo json_encode($return_arr); |
So as you can see PHP returns ID, text, and level.
When outside of jqgrid I can do
var ExtraData = $(this).select2(‘data’)[0];
if(ExtraData){
vLev = ExtraData.level;
}
But When inside jqgrid it looks like it returns just id and text but it’s missing all the extra values.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top