jQWidgets Forums
jQuery UI Widgets › Forums › Grid › createEverPresentRowWidget does not create record with Combobox fields
Tagged: angular grid, createEverPresentRowWidget, grid, jquery grid, jqxgrid
This topic contains 2 replies, has 2 voices, and was last updated by paulo.junior 9 years, 8 months ago.
-
Author
-
July 16, 2015 at 8:25 pm createEverPresentRowWidget does not create record with Combobox fields #73833
Good Afternoon,
We have the license jQWidgets, and we have a problem in creating registration online through jqxGrid component of the event:
“CreateEverPresentRowWidget” when we use the same fields Combobox type, using the component – jqxDropDownList. We are unable to post the back fields for our EndPoint. The fields in the combo box type, are not posted back, only fields of type TextBox able to receive the data.
Below the creation of Combobox field
// Source Class Adpater
var = classeSource
{
datatype: “json”
datafields: [
{Name: ‘ClasseId’},
{Name: ‘Description’}
]
id: ‘ClasseId’
url: “/ Register / P100DClasse / List”
async: false
};
classeAdapter var = new $ .jqx.dataAdapter (classeSource, {
AutoBind: true,
beforeLoadComplete: function (records) {
var date = new Array ();
for (var i = 0; i <records.length; i ++) {
var = records [i] class;
classe.ClasseId = classe.ClasseId;
classe.FaseDesc = classe.Descricao;
data.push (class);
}
return date;
}
});var url = “/ P100D / Request / List”;
var source =
{
datatype: “json”
type: “GET”
datafields:
[
{Name: ‘ClasseDesc’ map ‘Class> Description’, value: ‘ClasseId’ values: {source: classeAdapter.records, value: ‘ClasseId’ name: ‘Description’}},
{Name: ‘ClasseId’ map ‘Class> ClasseId’},
……………………………………..// Class
{
text: ‘Class’
align: ‘center’
width: 200,
datafield: ‘ClasseId’
displayField: ‘ClasseDesc’
columntype: ‘dropdownlist’createEverPresentRowWidget: function (datafield, HtmlElement, popup, addCallback) {
inputTag var = $ (“<div style =” border: none; ‘> </ div> “). appendTo (HtmlElement);
inputTag.jqxDropDownList ({popupZIndex: 99999999,
Placeholder: “Enter a class:”
source: classeAdapter,
DisplayMember: ‘Description’
width: ‘100%’,
height: 30,
theme: ‘office’});
return inputTag;
},
createeditor: function (row, value, editor) {
editor.jqxDropDownList ({
source: classeAdapter,
DisplayMember: ‘Description’
ValueMember: ‘ClasseId’
promptText: “Enter a Class”
});
}
},July 17, 2015 at 6:15 am createEverPresentRowWidget does not create record with Combobox fields #73850Hello paulo.junior,
Your code is syntactically incorrect on multiple occasions – missing commas after key-value pairs in the column definition, incorrectly initialized variable (inputTag before var) and mismatched quotes in the jQuery object you try to append –
$("<div style=" border: none; '> </ div>")
. Moreover, in beforeLoadComplete, you return an empty array (date) and you try pushing elements to an undefined array (data). That being said, it is no wonder your code does not run as expected.Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/July 17, 2015 at 12:42 pm createEverPresentRowWidget does not create record with Combobox fields #73882Hello Dimitar,
I’m sorry but it was changed to translate the code’s orders, because my English is not there great things. Sorry, but anyway I got to see the problem here was that I was not instantiating the creation of the elements in the code. Type:{
text: ‘Classe’,
align: ‘center’,
width: 200,
datafield: ‘ClasseId’,
displayfield: ‘ClasseDesc’,
columntype: ‘dropdownlist’,createEverPresentRowWidget: function (datafield, htmlElement, popup, addCallback) {
var inputTag = $(“<div style=’border: none;’></div>”).appendTo(htmlElement);
inputTag.jqxDropDownList({popupZIndex: 99999999,
placeHolder: “Informe uma Classe: “,
source: classeAdapter,
displayMember: ‘Descricao’,
valueMember: ‘ClasseId’,
width: ‘100%’,
height: 30,
theme: ‘office’});
return inputTag;
},
initEverPresentRowWidget: function (datafield, htmlElement) { },
getEverPresentRowWidgetValue: function (datafield, htmlElement, validate) { var value = htmlElement.val(); return value; },
resetEverPresentRowWidgetValue: function (datafield, htmlElement) { htmlElement.val(null); },
createeditor: function (row, value, editor) {
editor.jqxDropDownList({
source: classeAdapter,
displayMember: ‘Descricao’,
valueMember: ‘ClasseId’,
promptText: “Informe uma Classe”
});
}
},Thank you for your help …
Paulo Junior -
AuthorPosts
You must be logged in to reply to this topic.