var options = e.editorOptions; var rowIndex = e.row.rowIndex; var rowData = e.row.data; var dataGrid = $("#dataGrid").dxDataGrid("instance"); var exceptValue = ['undefined', 'null']; var column = e.dataField; var urlRowData = encodeURIComponent(JSON.stringify(rowData)); $filterValue) { if (is_array($filterValue)) { $filter2[$filterColumn] = implode(",", $filterValue); } elseif (strpos($filterValue, '"') !== false) { $filterValue = str_replace('"', "", $filterValue); $filter2[$filterColumn] = "{$filterValue}"; } else { $filter2[$filterColumn] = "'+ dataRow.{$filterValue} +'"; } } $filter = "&filter=" . json_encode_tr($filter2); } ?> if (e.dataField == "") { e.editorName = "dxAutocomplete"; e.editorOptions.searchEnabled = true; e.editorOptions.acceptCustomValue = true; e.editorOptions.dataSource = new DevExpress.data.ODataStore({ url: '', key: 'id', }); e.editorOptions.valueExpr = ''; e.editorOptions.displayExpr = ''; } var options = e.editorOptions; var rowIndex = e.row.rowIndex; var dataGrid = $("#dataGrid").dxDataGrid("instance"); var exceptValue = ['undefined', 'null']; if (e.dataField == "") { e.editorName = "dxAutocomplete"; e.editorOptions.searchEnabled = true; e.editorOptions.acceptCustomValue = true; e.editorOptions.showClearButton = true; e.editorOptions.dataSource = new DevExpress.data.ODataStore({ url: '', key: 'id', }); e.editorOptions.valueExpr = ''; e.editorOptions.displayExpr = ''; var fetchRelatedData = function(typedValue) { if (typedValue === null || typedValue === '') { return; } $.getJSON("?value=" + typedValue, function(responseJSON) { console.log(responseJSON); if (responseJSON && typeof responseJSON. !== 'undefined') { $valueCol) { $valueCol = str_replace('{', '${responseJSON.', $valueCol); ?> if (!exceptValue.includes(``)) { dataGrid.cellValue(rowIndex, "", ``); } else { console.log("except value "); } } else { console.log("undefined "); } }); }; options.onValueChanged = function(selectData) { console.log("on value changed"); e.setValue(selectData.value); if (options.__stellarExactMatchTimer) { clearTimeout(options.__stellarExactMatchTimer); } options.__stellarExactMatchTimer = setTimeout(function() { var typedValue = (selectData && typeof selectData.value !== 'undefined') ? selectData.value : null; fetchRelatedData(typedValue); }, 250); } options.onSelectionChanged = function(eSelection) { if (eSelection.selectedItem) { if (options.__stellarExactMatchTimer) { clearTimeout(options.__stellarExactMatchTimer); } // Use the value directly from the selected item var selectedValue = eSelection.selectedItem['']; fetchRelatedData(selectedValue); } } } $filterValue) { if (is_array($filterValue)) { $filter2[$filterColumn] = implode(",", $filterValue); } elseif (strpos($filterValue, '"') !== false) { $filterValue = str_replace('"', "", $filterValue); $filter2[$filterColumn] = "{$filterValue}"; } else { $filter2[$filterColumn] = "'+ dataRow.{$filterValue} +'"; } } $filter = "&filter=" . json_encode_tr($filter2); } ?> if (e.dataField == "") { e.editorName = "dxSelectBox"; e.editorOptions.searchEnabled = true; e.editorOptions.acceptCustomValue = true; e.editorOptions.allowCustomValues = true; e.editorOptions.dataSource = new DevExpress.data.ODataStore({ url: '', key: 'id', }); e.editorOptions.valueExpr = ''; e.editorOptions.displayExpr = ''; } var options = e.editorOptions; var rowIndex = e.row.rowIndex; var dataGrid = $("#dataGrid").dxDataGrid("instance"); var exceptValue = ['undefined', 'null']; if (e.dataField == "") { e.editorName = "dxSelectBox"; e.editorOptions.searchEnabled = true; e.editorOptions.acceptCustomValue = true; e.editorOptions.allowCustomValues = true; e.editorOptions.showClearButton = true; e.editorOptions.dataSource = new DevExpress.data.ODataStore({ url: '', key: 'id', }); e.editorOptions.valueExpr = ''; e.editorOptions.displayExpr = ''; options.onValueChanged = function(selectData) { e.setValue(selectData.value); if (options.__stellarExactMatchTimer) { clearTimeout(options.__stellarExactMatchTimer); } options.__stellarExactMatchTimer = setTimeout(function() { var typedValue = (selectData && typeof selectData.value !== 'undefined') ? selectData.value : null; if (typedValue === null || typedValue === '') { return; } $.getJSON("?order=&nolike=1&value=" + encodeURIComponent(typedValue), function(responseJSON) { console.log(responseJSON); if (responseJSON && typeof responseJSON. !== 'undefined') { $valueCol) { $valueCol = str_replace('{', '${responseJSON.', $valueCol); ?> if (!exceptValue.includes(``)) { dataGrid.cellValue(rowIndex, "", ``); } else { console.log("except value "); } } else { console.log("undefined "); } }); }, 250); } }