jQWidgets Forums
Forum Replies Created
Viewing 1 post (of 1 total)
-
Author
-
April 11, 2014 at 11:23 pm in reply to: Columntype Dropdown get selectedValue Columntype Dropdown get selectedValue #52970
Thank you for your reply, unfortunately that wasn’t what i need, but is my fault because i doesn’t explain it right.
I have an editable grid, with a dropdown column and i want to catch the value from the dropdown… not the label. I was wondering if is like the jqxDropdownlist, make an object (var item = $(this).jqxDropdownlist(“getSelectedItem”)) and call the value (item.value).
I left my code if you need to understand what i need:
var selectedIndex = 0; //This is the index, but in my database the id or value im looking for is the same plus one. var data = { datatype: "json", datafields: [ {name : "AlumnoID"}, {name : "Semestre"}, {name : "Nombre"}, {name : "CalificacionFinal"} ], id: "EgresadoID", url: "../../codes/ControlEscolar/Egresados.php", data: { accion : "SelectGrid", AlumnoID : ID }, updaterow: function(rowid, rowdata, commint){ var data = "accion=UpdateRecord&MateriaID=" + selectedIndex + "&EgresadoID=" + rowid + "&Semestre=" + rowdata.Semestre + "&CalificacionFinal=" + rowdata.CalificacionFinal; $.ajax({ dataType: "JSON", url: "../../codes/ControlEscolar/Egresados.php", data: data, success: function(data, status, xhr){ //commit(true); alert("Ok!"); }, error: function(data, status, xhr){ //commit(false); alert("Not Ok!"); } }); selectedIndex = 0; } }; $("#jqxGridEgresados").jqxGrid({ width: 800, height: 305, source: data, pageable: true, editable: true, selectionmode: "multiplecelladvanced", columns: [ {text: "Semestre", columntype: "numberinput", datafield: "Semestre", width: 100, initeditor: function(row, cellvalue, editor){ editor.jqxNumberInput({ spinButtons: true, min: 1, max: 9, decimalDigits: 0, digits: 1, decimal: 1 }); } }, {text: "Materia", columntype: "dropdownlist", datafield: "Nombre", width: 550, initeditor: function (row, cellvalue, editor) { editor.jqxDropDownList({source: dropdownSource, autoDropDownHeight: false, displayMember: "Nombre", valueMember: "MateriaID"}); }, //getting the "id" createeditor: function (row, column, editor){ editor.bind("select", function (event){ selectedIndex = event.args.index + 1; }); } }, {text: "Calificacion Final", columntype: "textbox", datafield: "CalificacionFinal", width: 150} ] });
Waiting for your reply. Thanks :3
-
AuthorPosts
Viewing 1 post (of 1 total)