Html NumberInput
Set the decimal property of the jqxNumberInput. Author: http://jqwidgets.com
by mogador
HTML
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
The Column [Prof] of the Grid is a combobox.
I Use the contribution of jgarcias, in this topic :Â https://www.jqwidgets.com/community/topic/initialize-combobox-column-in-jqxgrid/
But I don't know how to preselect rows in combobox when I fill the grid
(for example, aDataGrid[0]['idProfesseur'] = 1 in my example, but it doesn't select it in the combobox)
I can't either force selection with a click on the button.
<button id="bt_fill">Select idProf[0] in combobox Prof, on row 1 of the qrid</button>
<p>
</p>
<div id="jqxgrid"></div>
JavaScript
var aProfesseurs = [];
var aDataGrid = [];
// fill array combobox
var aLine = [];
aLine['idProfesseur'] = 0;
aLine['nomPrenom'] = 'James A';
aProfesseurs.push(aLine);
aLine = [];
aLine['idProfesseur'] = 1;
aLine['nomPrenom'] = 'John B';
aProfesseurs.push(aLine);
aLine = [];
aLine['idProfesseur'] = 2;
aLine['nomPrenom'] = 'Bob C';
aProfesseurs.push(aLine);
// fill array Grid
aLine = [];
aLine['idProfesseur'] = 1;
aLine['libelleGroupe'] = 'Group A';
aLine['idGroupe'] = '0';
aDataGrid.push(aLine);
aLine = [];
aLine['idProfesseur'] = 0;
aLine['libelleGroupe'] = 'Group B';
aLine['idGroupe'] = '12';
aDataGrid.push(aLine);
aLine = [];
aLine['idProfesseur'] = 2;
aLine['libelleGroupe'] = 'Group C';
aLine['idGroupe'] = '33';
aDataGrid.push(aLine);
var oSourceComboBox = {
localdata: aProfesseurs,
datatype: 'array',
datafields: [{
name: 'idProfesseur',
type: 'int'
},
{
name: 'nomPrenom',
type: 'string'
}
]
};
var oAdapterComboBox = new $.jqx.dataAdapter(oSourceComboBox);
var oSourceGrid = {
localdata: aDataGrid,
datatype: 'array',
datafields: [{
name: 'idProfesseur',
type: 'int',
values: {
source: oAdapterComboBox,
value: 'idProfesseur',
name: 'nomPrenom'
}
},
{
name: 'nomPrenom',
type: 'string'
},
{
name: 'libelleGroupe',
type: 'string'
},
{
name: 'idGroupe',
type: 'int'
}
],
id: 'idGroupe'
};
var oAdapter = new $.jqx.dataAdapter(oSourceGrid);
$('#jqxgrid').jqxGrid({
source: oAdapter,
selectionmode: 'singlecell',
editable: true,
editmode: "click",
columnsresize: true,
sortable: false,
sortmode: 'many',
// autoheight: true,
// autorowheight: true,
columns: [{
text: 'Prof',
editable: true,
datafield: 'idProfesseur',
displayfield: 'nomPrenom',
minwidth: 120,
width: '20%',
columntype: 'combobox',
createeditor: function(row, column,...