ComboBox Selection

12 views
Skip to first unread message

infringer

unread,
Sep 29, 2010, 4:00:13 PM9/29/10
to MyTableGrid
This is what my tableModel looks like:


var tableModel = {
options: {
width: '930px',
title: 'User Adminstration',
},
toolbar: {
elements: [ MyTableGrid.SAVE_BTN ],
onSave: function () {
alert('onSave');
console.log(arguments);
},
onAdd: function () {
alert('onAdd');
console.log(arguments);
},
onDelete: function () {
alert('onDelete');
console.log(arguments);
},
},
rowClass: function (rowId) {
if ((rowId % 2) == 0) return 'evenRow';
else return 'oddRow';
},
columnModel: [
{
id: 'user_id',
title: 'ID',
width: 40,
editable: true },
{
id: 'username',
title: 'Username',
width: 75,
editable: true },
{
id: 'userpassword',
title: 'Password',
width: 100,
editable: true },
{
id: 'first',
title: 'First Name',
width: 80,
editable: true },
{
id: 'last',
title: 'Last Name',
width: 80,
editable: true },
{
id: 'email',
title: 'E-Mail Address',
width: 150,
editable: true },
{
id: 'phone',
title: 'Phone #',
width: 100,
editable: true },
{
id: 'extension',
title: 'Ext',
width: 35,
editable: true },
{
id: 'initials',
title: 'Initials',
width: 40,
editable: true },
{
id: 'type',
title: 'User Type',
width: 80,
editable: true,
editor: new MyTableGrid.ComboBox({
list: [
{value: 'A', text: 'Administrator'},
{value: 'M', text: 'Multiple/Groups'},
{value: 'U', text: 'User'},
{value: 'X', text: 'InActive'},
]
})
},
{
id: 'title',
title: 'Job Title',
width: 100,
editable: true },
],
url: 'modules/admin/user/getUserTable.php',
paramRegen: function () {
var thisItem = new Object;
thisItem.showAll = CFescape($F('show_all'));
return thisItem;
}
}

paramRegen is the functionality I added to the code, just so anyone
knows. See post here, for more details:
http://groups.google.com/group/mytablegrid/browse_thread/thread/9f84cd3e9edab680

Anyway, getUserTable sends back the appropriate information but the
`type` field received is "A" or "U",.. etc... so what shows in the
table is the single letter "A" or "U" instead of "Administrator" or
"User". But if I try to convert and send Administrator or User, then
the cell just remains blank.

Is there any way to make it show the "text" value rather than the
"value" value. If that makes any sense.

-David

infringer

unread,
Sep 29, 2010, 4:18:52 PM9/29/10
to MyTableGrid
I even notice this effect on your sample at
http://pabloaravena.info/mytablegrid/release_notes.html the combo box
is showing the "value" rather than the descriptive "text"

-David

> knows.  See post here, for more details:http://groups.google.com/group/mytablegrid/browse_thread/thread/9f84c...

Reply all
Reply to author
Forward
0 new messages