jQWidgets Forums
Forum Replies Created
-
Author
-
November 12, 2013 at 9:25 pm in reply to: Uncaught TypeError: Cannot call method 'focus' of undefined Uncaught TypeError: Cannot call method 'focus' of undefined #32528
Tried editor.jqxDropDownList(“close”); But editor is the fieldName.
Do you have an example on how the get a handle on the editor instance.
Thanks,
November 12, 2013 at 5:08 pm in reply to: Uncaught TypeError: Cannot call method 'focus' of undefined Uncaught TypeError: Cannot call method 'focus' of undefined #32516Finally the error is back. here is the setValResults() function.
prt.emp.setValResults = function (row) {
var empGrid = $(“#empGrid”);
var cRow = empGrid.jqxGrid(‘getrowdata’, row);
var newVLR = prt.emp.setVLR(cRow);
var newTTR = prt.emp.setTTR(cRow);
empGrid.jqxGrid(‘beginupdate’);
empGrid.jqxGrid(‘setcellvalue’, row, ‘VLR’, newVLR);
empGrid.jqxGrid(‘setcellvalue’, row, ‘TTR’, newTTR);
empGrid.jqxGrid(‘endupdate’);
};November 12, 2013 at 4:38 pm in reply to: Uncaught TypeError: Cannot call method 'focus' of undefined Uncaught TypeError: Cannot call method 'focus' of undefined #32510Hi Peter,
I found another way of doing it which makes the error disappear. This also updates the field value in order to get the right value in the setter function. There was a delay and I was getting he previous value.
cellendedit: function (row, editor) {
var newVal = $(‘.jqx-dropdownlist-content’).find(‘span’).eq(‘0’).text();
$(‘#empGrid’).jqxGrid(‘setcellvalue’, row, “v1”, newVal );
prt.emp.setValResults(row);
},Lets me know if that makes sense.
Thanks,
November 11, 2013 at 3:16 pm in reply to: Changing field source values Changing field source values #32407My source is an XML file.
The data mapping is done as suggested:
var dataAdapter = new $.jqx.dataAdapter(source, {
downloadComplete: function (data, status, xhr) {
// get the data from the XML and push it into Array.
var records = $(source.root + ” ” + source.record, data);
var dataToReturn = [];
for (var i = 0; i < records.length; i++) {
var ejc = $(records[i]).attr('EJC');
var grp = $(records[i]).attr('GRP');As for the dropdownList. Right now, I am using the solutions provided another post using the initeditor callback to override the default values.
initeditor: function (row, value, editor) {
var EJC = $('#empGrid').jqxGrid('getcellvalue', row, "EJC");
if (prt.emp.isEmpType2(EJC)) {
editor.jqxDropDownList({ source: empType2.records, displayMember: 'label', valueMember: 'value' });
}
}I do all other fields mapping and calculations using the bindingcomplete event. This is a bit slow and I am trying to optimize it right now.
Thanks,
November 6, 2013 at 9:38 pm in reply to: Drop Down List in Grid, make DD List dependent on another columns value Drop Down List in Grid, make DD List dependent on another columns value #32098What’s the best way to handle dropdownlist per row. Each row needs to bind to different values lists and it need to show the right label depending on the row type.
var empType1val = [
{ value: 5, label: “E” },
{ value: 4, label: “K” },
{ value: 3, label: “S” },
{ value: 2, label: “N” },
{ value: 1, label: “U” }
];var empType2val = [
{ value: 3, label: “E” },
{ value: 2, label: “S” },
{ value: 1, label: “U” }
];// this only works per columns
{ name: ‘v1’, type: ‘string’, values: { source: empType1.records, value: ‘value’, name: ‘label’ } },text: ‘Customer First’, datafield: ‘v1’, width: ‘10%’, align: ‘center’, cellsalign: ‘center’, columntype: ‘dropdownlist’,
createeditor: function (row, value, editor) {
var EJC = $(‘#empGrid’).jqxGrid(‘getcellvalue’, row, “EJC”);
if (prt.empType1.indexOf(EJC) != -1) {
editor.jqxDropDownList({ source: empType1, displayMember: ‘label’, valueMember: ‘value’ });
}
else {
editor.jqxDropDownList({ source: empType2, displayMember: ‘label’, valueMember: ‘value’ });
}
}November 6, 2013 at 5:36 pm in reply to: Drop Down List in Grid, make DD List dependent on another columns value Drop Down List in Grid, make DD List dependent on another columns value #32073Looking for a way to bind to different lists. Do you have any examples on how to bind the value adapter into datafields: [].
{ name: ‘v1’, type: ‘string’, values: { source: ?.records, value: ‘value’, name: ‘label’ } },
createeditor: function (row, value, editor) {
if (row.empType = 0) {
editor.jqxDropDownList({ source: empType1, displayMember: ‘label’, valueMember: ‘value’ });
}
else {
editor.jqxDropDownList({ source: empType2, displayMember: ‘label’, valueMember: ‘value’ });
}
}Thanks,
Thanks, I was looking for a way to have it work side by side with a tree navigation. it gets a bit oakward when I use a fix width for tree container. Other than that works fine.
When i set grid columns in %. The scroll bar disappears.
-
AuthorPosts