jQWidgets Forums
Forum Replies Created
-
Author
-
i found following :
********* REMOVED CODE DUE TO EULA VIOLATION **************
This works…….
No idea?
i try this way:
var data = generatedata(500); var countries = [ { value: "AF", label: "Afghanistan" }, { value: "AL", label: "Albania" }, { value: "DZ", label: "Algeria" }, { value: "AR", label: "Argentina" }, { value: "AM", label: "Armenia" }, { value: "UK", label: "United Kingdom" }, { value: "US", label: "United States" } ]; var countriesSource = { datatype: "array", datafields: [ { name: 'label', type: 'string' }, { name: 'value', type: 'string' } ], localdata: countries }; var countriesAdapter = new $.jqx.dataAdapter(countriesSource, { autoBind: true }); var source = { localdata: data, datafields: [{ name: 'firstname', type: 'string' }, { name: 'lastname', type: 'string' }, { name: 'productname', type: 'string' }, { name: 'date', type: 'date' }, { name: 'quantity', type: 'number' }, { name: 'price', type: 'number' }], datatype: "array" }; var groupcolumnrenderer = function (text) { console.log(text); if (text === 'Country') { return 'Land'; } else { return text; } } var adapter = new $.jqx.dataAdapter(source); $("#jqxgrid").jqxGrid({ width: 500, theme: 'energyblue', source: adapter, groupcolumnrenderer: groupcolumnrenderer, groupable: true, groups: ['countryCode'], //groupsrenderer: groupsrenderer, editable: true, columns: [{ text: 'First Name', datafield: 'firstname', width: 90, columntype: 'dropdownlist' }, { text: 'Last Name', datafield: 'lastname', width: 90 }, { text: 'Product', datafield: 'productname', width: 170 }, { text: 'Order Date', datafield: 'date', width: 160, cellsformat: 'dd-MMMM-yyyy' }, { text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' }, { text: 'Unit Price', datafield: 'price', cellsalign: 'right', cellsformat: 'c2' },{ text: 'Country', datafield: 'countryCode', displayfield: 'Country', columntype: 'dropdownlist', createeditor: function (row, value, editor) { editor.jqxDropDownList({ source: countriesAdapter, displayMember: 'label', valueMember: 'value' }); }} ] });
Then it works, when you load the grid.
When you close the group and group Country again, it doesn’t work…..Hmm…when you create the column this way:
, { text: '@Resources.MeterType.MeterTypeModel_Unit', columntype: 'dropdownlist', displayfield: 'Unit', datafield: "UnitId", placeHolder: "Bitte wählen", filtertype: 'checkedlist', width: 150, validation: function (cell, value) { if (value) { return true; } return { result: false, message: "@Resources.CostCenter.Error_Grid_Number" }; } , createeditor: function (row, cellvalue, editor) { editor.jqxDropDownList({ source: dataAdapterUnit, displayMember: 'Symbol', valueMember: 'Id', placeHolder: "Bitte wählen", dropDownHeight: 100 }); }, }
It doenst work
It is very simple to reporduce it.
Take a grid with a columntype: ‘dropdownlist’.
Group this column and you will see the problemBut now, i have the probelm at groupsrenderer.
There is always “State” as Label.
And i get an Error:
TypeError: data.groupcolumn is nullso i implemented this workaround:
var groupcolumnrenderer = function (text) {
var toCheck = “”;
if (typeof text === ‘string’) {
return text;
} else {
for (var i = 0; i < text.length; i++) {
toCheck += text[i];
}
if (toCheck === ‘State’) {
return ‘@Resources.State’;
} else if (toCheck === ‘Country’) {
return ‘@Resources.Country’;
}
}
}I am not sure, that the label is default the “text”.
When the Cloumn is columntype: ‘dropdownlist’, then he takes always the displayfield.
When i call groupcolumnrenderer, then i get an array the value from displayfield….
0 “U”
1 “n”
2 “i”
3 “t”When the column isn’t ‘dropdownlist’, then i get an string…
Do you have an example?
December 16, 2014 at 10:58 am in reply to: getselectedcells always 1 getselectedcells always 1 #64257The Problem is, that the mouseup Event is faster then the selection event….
$("#matrix").mouseup(function () { cells = $("#matrix").jqxGrid("getselectedcells"); console.log("Seleted Cells: " +cells.length); });
SELECTED CELLS IS ALWAYS 1….hmmmmmm
Sorry, have grid.
Do you have an example?$("#matrix").mouseup(function() { var groupsSize = $("#Matrix_Groups").val(); if (cells.length > groupsSize) { $("#matrix").jqxGrid('clearselection'); } else if (cells.length === groupsSize) { $("#popUpBit").jqxWindow('open'); }
I tried this way.
This is OK, when you selected the cell with CTRL and Mouse Click. But not, when you select the cell with mouse and pressed mouse button….I wanna do something like this:
//CELLSELECT EVENT $("#matrix").bind("cellselect", function (event) { cells = $("#matrix").jqxGrid("getselectedcells"); var groupsSize = $("#Matrix_Groups").val(); if (cells.length === groupsSize) { console.log("READY"); } else if (cells.length > groupsSize) { $("#matrix").jqxGrid('clearselection'); } });
The console.log() fires every time, when the selction == groupSize.
I only want to have this condition, when my selection is finished(mouse event)OK.
Can i get the “getselectedcells” without a button click?
I wanted to know, how many cells i selected.
I have this mode:
.jqxGrid(“selectionmode”, “multiplecellsextended”);December 1, 2014 at 10:37 am in reply to: hideSeries and Y-Axis reload hideSeries and Y-Axis reload #63564I found it….
only set Axis to ‘auto’, without unitInterval, minValue and maxValue…. -
AuthorPosts