jQWidgets Forums
Forum Replies Created
-
Author
-
Hi Peter,
will you please help me, i checked dataAdapter is retrieve records.
Regards,
lalit singh
Hi Peter,
I checked , dataAdapter is having records,
please show me line of my sample code exactly , what needs to be put in.
regards,
lalit singh
Hi Peter,
Yes, I am using dataadapter to bind dropdownlist, as it has to be come from database. can you provide solution for this. or let me know what information you want from me.
or else you can suggest any modification please.
regards,
lalit singh
Hi Peter,
Please find this link , http://jsfiddle.net/5Y959/
Hope this is what you want it to be.
please let me know what is the issue, as I am stucked in middle of work.
Regards,
lalit singh
Hi Peter,
thanks for your response. can you look at it http://jsfiddle.net/ufNDr/ please. I have updated my sample page here.
regards,
lalit singh
Hi Peter,
again pasting…..
I am using , string array to populate dropdownlist using adapter,below is the sample code
var arrsource = new Array();
arrsource[0] = ({ value: “0”, label: “Solicited” })
arrsource[1] = ({ value: “1”, label: “Proactive” })var arrdefend = new Array();
arrdefend[0] = ({ value: “0”, label: “Defend” })
arrdefend[1] = ({ value: “1”, label: “Attack” })var strsourcefield = {
datatype: “array”,
datafields: [
{ name: ‘label’, type: ‘string’ }],
localdata: arrsource
}var strdefendsource = {
datatype: “array”,
datafields: [
{ name: ‘label’, type: ‘string’ }],
localdata: arrdefend
}var segmentsAdapter = new $.jqx.dataAdapter(strsegmentsource, { autoBind: true });
var subsegmentsAdapter = new $.jqx.dataAdapter(strsubsegmentsource, { autoBind: true });
var sourceAdapter = new $.jqx.dataAdapter(strsourcefield, { autoBind: true });
var defendAdapter = new $.jqx.dataAdapter(strdefendsource, { autoBind: true });
// prepare the data
var source =
{
datatype: “array”,
localdata: data,
//sort: customsortfunc,
datafields: [{ name: ‘KeyProjectId’, type: ‘string’ },
{ name: ‘ListOfProjects’, type: ‘string’ },
{ name: ‘Source’, value: ‘fir_source’, type: ‘string’, values: { source: sourceAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘Defend’, value: ‘fir_defend’, type: ‘string’, values: { source: defendAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘Segments’, value: ‘segmentCode’, values: { source: segmentsAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘SubSegments’, value: ‘subsegmentCode’, values: { source: subsegmentsAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘Segments’, value: ‘fir_segment’, type: ‘string’, values: { source: segmentsAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘SubSegments’, value: ‘fir_subsegment’, type: ‘string’, values: { source: subsegmentsAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘Potential’, type: ‘number’ }
]
};
var dataAdapter = new $.jqx.dataAdapter(source);// initialize jqxGrid
$(“#jqxgrid”).jqxGrid(
{width: 1000,
source: dataAdapter,
editable: true,
selectionmode: ‘singlerow’,
sortable: true,
editmode: ‘selectedcell’,
columnsresize: true,
autoheight: true,
theme: ‘redmond’,
pageable: true,columns: [
{ text: ‘KeyProjectId’, datafield: ‘fir_keyprojectId’, displayfield: ‘KeyProjectId’, columntype: ‘textbox’ },
{ text: ‘List Of Projects’, datafield: ‘ListOfProjects’, displayfield: ‘ListOfProjects’, columntype: ‘textbox’, width: 200 },
{ text: ‘Source’, datafield: ‘fir_source’, displayfield: ‘Source’, columntype: ‘dropdownlist’, width: 150,
createeditor: function (row, value, editor) {editor.jqxDropDownList({ autoDropDownHeight: true, source: sourceAdapter, displayMember: ‘label’, valueMember: ‘value’ });}
},
{ text: ‘Defend’, datafield: ‘fir_defend’, displayfield: ‘Defend’, columntype: ‘dropdownlist’, width: 150,
createeditor: function (row, value, editor) {editor.jqxDropDownList({ autoDropDownHeight: true, source: defendAdapter, displayMember: ‘label’, valueMember: ‘value’ });}
},
{ text: ‘Segments’, datafield: ‘fir_segment’, displayfield: ‘Segments’, columntype: ‘dropdownlist’, width: 150,
createeditor: function (row, value, editor) {editor.jqxDropDownList({ autoDropDownHeight: true, source: segmentsAdapter, displayMember: ‘label’, valueMember: ‘value’ });},
cellvaluechanging: function (row, datafield, columntype, oldvalue, newvalue) {if (newvalue != oldvalue) {$(“#jqxgrid”).jqxGrid(‘setcellvalue’, row, “SubSegments”, “Please Choose:”);};}
},
{ text: ‘SubSegments’, datafield: ‘fir_subsegment’, displayfield: ‘SubSegments’, columntype: ‘dropdownlist’, width: 150,
initeditor: function (row, column, editor, celltext, cellwidth, cellheight) {
// assign a new data source to the combobox.
//var selectedSegments = $(‘#jqxgrid’).jqxGrid(‘getcellvalue’, row, “fir_segment”);
var selectedSegments = $(‘#jqxgrid’).jqxGrid(‘getcellvalue’, row, “Segments”);
var subseg = editor.val();
var fillsubsegment = new Array();
switch (selectedSegments) {
case “Beverage”:
fillsubsegment = [‘Alcoholic Drinks’, ‘Carbonated Soft Drinks’, ‘Hot Drinks’, ‘Ingredients FL’, ‘Juices and Nectars’, ‘Powder Soft Drinks’, ‘Special Soft Drinks’, ‘Unknown Beverages’];
break;
case “Body Care”:
fillsubsegment = [‘AntiP/Deo’, ‘Body Care Mass Perfume’, ‘Body Wash’, ‘Hair Care’, ‘Oral Care (BC)’, ‘Skin Care’, ‘Soap bar’];
break;
};
editor.jqxDropDownList({ autoDropDownHeight: true, source: fillsubsegment });
if (subseg != “Please Choose:”) {
var index = fillsubsegment.indexOf(subseg);
editor.jqxDropDownList(‘selectIndex’, index);
}},
// update the editor’s value before saving it.
cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
// return the old value, if the new value is empty.if (newvalue == “”) return oldvalue;
//$(“#fillsubsegment”).on(‘change’, createeditor )
}
}]
});I have 3 dropdownlist columns, when I click on this, it shows below error on IE 10
SCRIPT5007: Unable to get property ‘_arrange’ of undefined or null reference
jqxdropdownlist.js, line 7 character 33286
HTML1527: DOCTYPE expected. The shortest valid doctype is “<!DOCTYPE html>”.
about:blank, line 1 character 1
SCRIPT5007: Unable to get property ‘_arrange’ of undefined or null reference
jqxdropdownlist.js, line 7 character 33286
SCRIPT5007: Unable to get property ‘_arrange’ of undefined or null reference
jqxdropdownlist.js, line 7 character 33286
SCRIPT5007: Unable to get property ‘_arrange’ of undefined or null reference
jqxdropdownlist.js, line 7 character 33286
SCRIPT5007: Unable to get property ‘visibleItems’ of undefined or null reference
jqxgrid.edit.js, line 7 character 22533
SCRIPT5007: Unable to get property ‘_arrange’ of undefined or null reference
jqxdropdownlist.js, line 7 character 33286I am unable to attach , screenshot in this blog show pasted above error lines.
Regards,Lalit Singh
Hi Peter,
below is the sample code
// prepare the data
var source =
{
datatype: “array”,
localdata: data,
//sort: customsortfunc,
datafields: [{ name: ‘KeyProjectId’, type: ‘string’ },
{ name: ‘ListOfProjects’, type: ‘string’ },
{ name: ‘Source’, value: ‘fir_source’, type: ‘string’, values: { source: sourceAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘Defend’, value: ‘fir_defend’, type: ‘string’, values: { source: defendAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘Segments’, value: ‘segmentCode’, values: { source: segmentsAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘SubSegments’, value: ‘subsegmentCode’, values: { source: subsegmentsAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘Segments’, value: ‘fir_segment’, type: ‘string’, values: { source: segmentsAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘SubSegments’, value: ‘fir_subsegment’, type: ‘string’, values: { source: subsegmentsAdapter.records, value: ‘value’, name: ‘label’ } },
{ name: ‘Potential’, type: ‘number’ }
]
};
var dataAdapter = new $.jqx.dataAdapter(source);// initialize jqxGrid
$(“#jqxgrid”).jqxGrid(
{width: 1000,
source: dataAdapter,
editable: true,
selectionmode: ‘singlerow’,
sortable: true,
editmode: ‘selectedcell’,
columnsresize: true,
autoheight: true,
theme: ‘redmond’,
pageable: true,columns: [
{ text: ‘KeyProjectId’, datafield: ‘fir_keyprojectId’, displayfield: ‘KeyProjectId’, columntype: ‘textbox’ },
{ text: ‘List Of Projects’, datafield: ‘ListOfProjects’, displayfield: ‘ListOfProjects’, columntype: ‘textbox’, width: 200 },
{ text: ‘Source’, datafield: ‘fir_source’, displayfield: ‘Source’, columntype: ‘dropdownlist’, width: 150,
createeditor: function (row, value, editor) {editor.jqxDropDownList({ autoDropDownHeight: true, source: sourceAdapter, displayMember: ‘label’, valueMember: ‘value’ });}
},
{ text: ‘Defend’, datafield: ‘fir_defend’, displayfield: ‘Defend’, columntype: ‘dropdownlist’, width: 150,
createeditor: function (row, value, editor) {editor.jqxDropDownList({ autoDropDownHeight: true, source: defendAdapter, displayMember: ‘label’, valueMember: ‘value’ });}
},
{ text: ‘Segments’, datafield: ‘fir_segment’, displayfield: ‘Segments’, columntype: ‘dropdownlist’, width: 150,
createeditor: function (row, value, editor) {editor.jqxDropDownList({ autoDropDownHeight: true, source: segmentsAdapter, displayMember: ‘label’, valueMember: ‘value’ });},
cellvaluechanging: function (row, datafield, columntype, oldvalue, newvalue) {if (newvalue != oldvalue) {$(“#jqxgrid”).jqxGrid(‘setcellvalue’, row, “SubSegments”, “Please Choose:”);};}
},
{ text: ‘SubSegments’, datafield: ‘fir_subsegment’, displayfield: ‘SubSegments’, columntype: ‘dropdownlist’, width: 150,
initeditor: function (row, column, editor, celltext, cellwidth, cellheight) {
// assign a new data source to the combobox.
//var selectedSegments = $(‘#jqxgrid’).jqxGrid(‘getcellvalue’, row, “fir_segment”);
var selectedSegments = $(‘#jqxgrid’).jqxGrid(‘getcellvalue’, row, “Segments”);
var subseg = editor.val();
var fillsubsegment = new Array();
switch (selectedSegments) {
case “Beverage”:
fillsubsegment = [‘Alcoholic Drinks’, ‘Carbonated Soft Drinks’, ‘Hot Drinks’, ‘Ingredients FL’, ‘Juices and Nectars’, ‘Powder Soft Drinks’, ‘Special Soft Drinks’, ‘Unknown Beverages’];
break;
case “Body Care”:
fillsubsegment = [‘AntiP/Deo’, ‘Body Care Mass Perfume’, ‘Body Wash’, ‘Hair Care’, ‘Oral Care (BC)’, ‘Skin Care’, ‘Soap bar’];
break;
};
editor.jqxDropDownList({ autoDropDownHeight: true, source: fillsubsegment });
if (subseg != “Please Choose:”) {
var index = fillsubsegment.indexOf(subseg);
editor.jqxDropDownList(‘selectIndex’, index);
}},
// update the editor’s value before saving it.
cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
// return the old value, if the new value is empty.if (newvalue == “”) return oldvalue;
//$(“#fillsubsegment”).on(‘change’, createeditor )
}
}]
});I have 3 dropdownlist columns, when I click on this, it shows below error on IE 10
SCRIPT5007: Unable to get property ‘_arrange’ of undefined or null reference
jqxdropdownlist.js, line 7 character 33286
HTML1527: DOCTYPE expected. The shortest valid doctype is “<!DOCTYPE html>”.
about:blank, line 1 character 1
SCRIPT5007: Unable to get property ‘_arrange’ of undefined or null reference
jqxdropdownlist.js, line 7 character 33286
SCRIPT5007: Unable to get property ‘_arrange’ of undefined or null reference
jqxdropdownlist.js, line 7 character 33286
SCRIPT5007: Unable to get property ‘_arrange’ of undefined or null reference
jqxdropdownlist.js, line 7 character 33286
SCRIPT5007: Unable to get property ‘visibleItems’ of undefined or null reference
jqxgrid.edit.js, line 7 character 22533
SCRIPT5007: Unable to get property ‘_arrange’ of undefined or null reference
jqxdropdownlist.js, line 7 character 33286I am unable to attach , screenshot in this blog show pasted above error lines.
Regards,Lalit Singh
Hi ,
please find the attached image, I am getting error on click of dropdownlist on IE 10 , m using latest version 3.2.1.
it shows error on “b.listBox._arrange” on click of dropdownlist on IE 10. below is piece of code from dropdownlist.js
`({height:b.dropDownHeight});b.container.height(parseInt(b.dropDownHeight)+25)}b.listBox._arrange();b.listBox._updatescrollbars()}if(c==”searchMode”)
regards,
lalit singh
February 23, 2014 at 6:18 am in reply to: after delete , unable to refresh grid. after delete , unable to refresh grid. #49944Hi Peter Stoev,
I am using same function, but the grid still shows the record. its only when i close and reopen my page then that rows is not seen.
on click , its not working it seems, below is my code. i am using 3.1.0 version.
$(“#deleterowbutton”).on(‘click’, function () {
var selectedrowindex = $(“#jqxgrid”).jqxGrid(‘getselectedrowindex’);
if (selectedrowindex < 0)
alert(“Please select a row to delete”);debugger;
var rowscount = $(“#jqxgrid”).jqxGrid(‘getdatainformation’).rowscount;
if (selectedrowindex >= 0 && selectedrowindex < rowscount) {
var id = $(“#jqxgrid”).jqxGrid(‘getrowid’, selectedrowindex);
var rowdata = $(“#jqxgrid”).jqxGrid(‘getrowdatabyid’, id);
var testrow = retrievePMData(APID);
var gid = testrow[0].fir_fir_accountplans_fir_postmortemanalysis.results[selectedrowindex].fir_postmortemanalysisId;
var rowid;
//debugger;
if (rowdata[“fir_postmortemanalysisId”] == undefined || rowdata[“fir_postmortemanalysisId”].length == undefined) {
//alert(“This row is not yet saved, so can’t be deleted. Please refresh your page.”)
rowid = gid;
}
else {
if (rowdata[“fir_postmortemanalysisId”] && rowdata[“fir_postmortemanalysisId”] != null) {
rowid = rowdata[“fir_postmortemanalysisId”];
}
else {rowid = rowdata[“uid”];
}
}
//var commit = $(“#jqxgrid”).jqxGrid(‘deleterow’, id);
//$(‘#jqxgrid’).jqxGrid({ editable: true });
var commit = $(“#jqxgrid”).jqxGrid(‘deleterow’, rowid);
//$(‘#jqxgrid’).jqxGrid({ editable: true });
$(“#jqxgrid”).jqxGrid(‘refreshdata’); // this i used as ‘deleterow’ was not removing deleted row
$(“#jqxgrid”).jqxGrid(‘refresh’);// this i used as ‘deleterow’ was not removing deleted row
}February 21, 2014 at 3:16 pm in reply to: showing load image when jqxgrid loads showing load image when jqxgrid loads #49884Hi Dimitar,
thanks for your reply. any sample code or demo would you suggest please
regards,
lalit singh
February 21, 2014 at 8:56 am in reply to: showing load image when jqxgrid loads showing load image when jqxgrid loads #49864Hi Dimitar,
i tried to put both , but not working. below is my sample code
$(‘#jqxgrid’).jqxGrid(‘showloadelement’);
$(“#jqxgrid”).jqxGrid(
{
width: ‘100%’,
source: dataAdapter,
pageable: true,
editable: true,
autorowheight: true,
enabletooltips: true,
selectionmode: ‘singlecell’,
//selectionmode: ‘singlerow’,
editmode: ‘click’,
// editmode: ‘selectedcell’,
altrows: true,
columnsresize: true,
theme: ‘redmond’,
autoheight: true,
showstatusbar: true,
statusbarheight: 25,
showaggregates: true,
sortable: true,
//scrollmode: ‘logical’,
scrollmode: ‘default’,
//filterable: true,
//filtermode: ‘excel’,
ready: function () {
$(‘#jqxgrid’).jqxGrid(‘hideloadelement’);
//rowsLength = $(“#jqxgrid”).jqxGrid(“getrows”).length;},
February 20, 2014 at 1:30 pm in reply to: make only newly added row as editable , others as false make only newly added row as editable , others as false #49821Hi Dimitar,
Thanks for the information.
right now , all rows are editable=false, new row= editable true. i want to make specific column as editable=true with these.
regards,
lalit singh
February 18, 2014 at 8:42 am in reply to: after entering multiple rows, the value entered removes on mouse click after entering multiple rows, the value entered removes on mouse click #49663Dear Dimitar,
Its working fine. it was mistake from my side, that my datafield and column datafield were not matching.
Thanks,
Lalit Singh
Cellformat to “f2″. its not working. i am providng columntype=”numberinput” then also not working
but rendering works.
Thanks,
lalit singh
-
AuthorPosts