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.
thank you!
I’m sorry I have one last question.
Is there a way to reduce row height?
I tried:
padding-top: 0.1rem;
padding-bottom: 0.1rem;
but it just changes padding top (no bottom).
Any ideas?
Ok thank you for the suggestion!
Also, please try to consider what I suggested regarding the header.
I would like to use this new function but I cannot because the grid in my project starts empty and it displays all the columns name truncated. It’s really bad to see.
thank you again.
Thank you.
for some reason your suggestion did not work but it worked this:
.ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td {
padding-right: 0.75rem;
}
Just to give you a second opinion: I program also in delphi and I use devexpress grid. Those grids function like that:
this is just to give you some ideas.
probably you were still releasing because now I see some changes and some other problems too:
what do you think?
i updated jsfiddle
Hello,
thank you for answering me and for the great support.
However, I tried but I do not see it working. Could you check my jsfiddle? first column still have missing numbers
Thank you,
Lorenzo
Thank you again.
Regarding .2 I understand what you’re saying.
But still, on a configuration like this, shouldn’t you something to fix the view?
Please check this attachment:
https://mega.nz/#!2JwWWSQL!QRFay4GIvaEQBgnrxoIxxxiWUFa079becJoDdCukEO8
i have added some notes
Hello,
first of all thank you so much for your answers and for the fixes.
Thank you.
For some reason on jsfiddle grid do not appear until i resize the page, this do not happens in the real project. So if you do not see the grid, resize it and you will see the problem with the actions button.
Also, I found out the problem is with:
autowidth:true
with that enabled, i have the problem. If I disable it everything works.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top