Hi to all,
I have a question about the Grid with the filter columns ( using #select_filter) I try to explain with an example:
I have a grid 2 columns with filter combo (process and subprocess)
PROCESS, SUBPROCESS
A 1
A 2
B 3
B 4
The combo contains these items PROCESS(A,B), SUBPROCESS(1,2,3,4) I need this behavior:
if I select the SUBPROCESS combo for example 1, I see in the Grid this situation
PROCESS, SUBPROCESS
A 1
I need that the combo PROCESS now contains only the item (A).
After I need to use a button that reset the situation.
I use CheckListGrid.parse(data, GridLoaded, “jsarray”); and not load method.
I attach also a part of code.
function PrepareLayout() {
if (!layoutPrepared) {
//
//
// Istanzia la grid
CheckListGrid = new dhtmlXGridObject('DivGridCheckList');
// Header setup
CheckListGrid.setHeader("Processo,Sotto processo,Tipologia Documento, ,Documenti",
null,
["text-align:left;", "text-align:left;", "text-align:left", "text-align:center", "text-align:center"]
);
CheckListGrid.setColAlign("left,left,left,center,center");
CheckListGrid.setColTypes("ro,ro,ro,ro,ro");
//CheckListGrid.setColTypes("ro,ro,ro,ro,acheck");
CheckListGrid.attachHeader("#select_filter,#select_filter,#select_filter,,#select_filter");
//CheckListGrid.setInitWidths("*,*,*,100,120");
CheckListGrid.setInitWidthsP("30,20,20,20,10");
CheckListGrid.setColSorting("str,str,str,null,str");
CheckListGrid.enableSmartRendering(true);
//LD Add on 19-08-2015
//aggiunta per cercare di abbassare la grandezza dell'header
CheckListGrid.enableAutoHeight(false);
$('table.hdr td div.hdrcell').css('margin','0');
$('table.hdr td div.hdrcell').css('height','16');
// Init
CheckListGrid.init();
layoutPrepared = true;
}
}
…
function GridLoaded() {
///
/// Callback di fine caricamento Grid (chiamata da MakeCheckListGrid)
///
// Behaviors per sorting
CheckListGrid.enableStableSorting(true);
CheckListGrid.sortRows(0, "str", "asc");
CheckListGrid.setSortImgState(true, 0, "asc");
// Gestione immagine semaforo (trick via CSS)
for (var i = 1; i < CheckListGrid.getRowsNum() + 1; i++) {
var imageBackground = "checklistdocumentale_grid_false_flag.png";
var cell = CheckListGrid.cells(i, 4);
if (cell) {
var cellVal = cell.getValue();
}
if (cellVal.length > 0) {
if (cellVal.indexOf("Presenti") > -1) {
imageBackground = "checklistdocumentale_grid_true_flag.png";
}
var img = window.location.href.substr(0,window.location.href.lastIndexOf('/')) + "/" + imageBackground;
CheckListGrid.setCellTextStyle(i, 4, "background: url('" + img + "') no-repeat;display: inline-block;height: 32px;width: 32px;font-size:1px;color:white;text-align:center;text-indent: -9999px;background-position: 50% 0%;");
}
};
// Fine dei giochi, calcola e setta i sizes...
CheckListGrid.setSizes();
$('#DivEmptyMessage').hide();
$('#DivLoading').hide();
$('#DivGridCheckList').show();
}
…
function MakeCheckListGrid(data) {
///
/// Compone la GRID con i dati ricevuti
///
// Check consistenza
if (data.length == null || data.length == undefined || data.length == 0) {
ManageEmpty();
return;
}
localData = data;
// Data parsing
CheckListGrid.clearAll();
CheckListGrid.parse(data, GridLoaded, "jsarray");
CheckListGrid.filterByAll();
}
Thanks in adcance