Showing Radio button on Listgrid

Hi,

I was wondering if there is a way to show a radio button on each record within a listgrid object. I have provided code below:

isc.DataSource.create({
ID:“assignedTeamMemberEmployee”,
fields:[
{name: “employeeid”, title: “Employee ID”, primaryKey: true},
{name: “fullname”, title: “Employee Name”},
{name: “site”},
{name: “building”},
{name: “homeCostCenter”},
{name: “workCostCenter”},
{name: “isOwner”, title: “Owner”}
],
clientOnly: true,
testData: exampleData2
})

isc.defineClass(“TeamMemberAssignedListGrid”,“ListGrid”).addProperties({
width: 300,
height: 250,
cellHeight: 24,
imageSize: 16,
leaveScrollbarGap: false,
alternateRecordStyles: true,
canPickFields: false,
canGroupBy: false,
canFreezeFields: false,
showAllColumns: false,
showAllRecords: false,
showRollOver: false,
sortFieldNum: 0,
sortDirection: “ascending”,
emptyMessage: “<b>Please add team members through the Employee List.</b>”,
showHeader: true,
fields:[
{name: “fullname”, title: “Employee Name”, width: 200},
{name: “employeeid”, title: “Employee ID”, width: 100},
{name: “isOwner”, title: “Owner”, type:“radioGroup”, width: 50}
],
dragTrackerMode: “icon”,
trackerImage:{ src: “person.png”, width: 16, height: 16},
dataSource: assignedTeamMemberEmployee,
autoFetchData: true,
canDragRecordsOut: false,
canAcceptDroppedRecords: true
})

Can you provide an approach that accomplishes this? Am I on the right track? Thanks.

Newt

Setting type:“boolean” will render a field using the booleanTrueImage and booleanFalseImage. However, if you want only a single record to be able to be marked, you’ll need to add that logic yourself.

In this case, it would involve two dsRequests, both “updates”, one to the old record to mark it no longer the owner, and one to the new record to mark it the new owner.

Use queuing (RPCManager.startQueue()) to do this in a single HTTP request.

I am not sure what this means. Can you provide an example?

Thanks for any help you can give.

It seems like a pretty straightforward explanation, so I’m guessing the problem is, we’re describing a solution for the wrong problem :slight_smile:

Can you provide a screenshot or deeper description of what you’re trying to accomplish?

Hi,

Basically, I have records listed in a listgrid with data going across. In one of these columns is a radio button that flags whether this record is describing an owner of something or not. If this record is flagged with a radio button as true, the other records listed within the listgrid should all be untoggled or set to false.

Does that help in describing what I am trying to do?

I could not past a snapshot in here.

OK, that is what we thought you were doing :slight_smile:

So set type:“boolean” on the isOwner field - you will then see a check image for whatever record has isOwner set to “true”.

Then, updating the current own involves using DataSource.updateData() twice - once to set isOwner:false on the previous owner, once to set isOwner true on the new owner. Make sense?

(by the way to post screenshots, stick them somewhere externally accessible and link to them here)

Due to that fact that we did not want to autoSave the edits in the grid, we turned set autoSaveEdits: false. As such, what events are fired to track these boolean field changes. I need to simulate a radio button with these boolean fields. I posted a similar question on another post.

Thanks.

listGridField.changed() fires every time the user makes a change (before it is saved).