We have a situation where we are trying to show in a list view the text of a radio button instead of a number. Why on earth Umbraco shows the radio button id instead of the label text in a list view is beyond me and is useless for clients.
We have made a change in the past by getting the radio button list and pulling the label text that way. We are now in a situation where we have something like this to populate a list view for members.
You should call your getOrgPrevalues() method in initView; and then you can update the data coming from the controller in the setPropertyValues method.
An alternative to this would be to pad the Member Index with a resolved value for organization, which will give you the benefit of being able to retrieve the value as part of the dataset without having to look up the prevalues.
Then I followed what you did to change the "Approved" column text by added this line to the setPropertyValues function.
if (alias === "organization") {
value = getOrganizationPropertyValue(alias, result.properties);
//console.log("value: " +value);
}
I used your getCustomPropertyValue function to retrieve the organization value from the 'prevaluesOrg' variable containing the JSON data.
function getOrganizationPropertyValue(alias, properties) {
var value = '';
var index = 0;
var foundAlias = false;
for (var i = 0; i < properties.length; i++) {
if (properties[i].alias === alias) {
foundAlias = true;
break;
}
index++;
}
if (foundAlias) {
value = newvalue[0].value[properties[index].value].value;
}
return value;
}
Listview Values
We have a situation where we are trying to show in a list view the text of a radio button instead of a number. Why on earth Umbraco shows the radio button id instead of the label text in a list view is beyond me and is useless for clients.
We have made a change in the past by getting the radio button list and pulling the label text that way. We are now in a situation where we have something like this to populate a list view for members.
This works, but the "Organization" is showing the radiobutton id. In the past we did something like this:
I am not sure how we would do the same thing with the $scope.model.config. Any ideas?
-Lee
Hi Lee,
You should call your
getOrgPrevalues()
method ininitView
; and then you can update the data coming from the controller in thesetPropertyValues
method.An alternative to this would be to pad the Member Index with a resolved value for
organization
, which will give you the benefit of being able to retrieve the value as part of the dataset without having to look up the prevalues.What I ended up doing is first getting all of the organizations.
First I needed to add "dataTypeResource" to the memberListViewController function.
I added my custom column to the includeProperties around line 39.
I added this to the initView method to get the organizations.
Then I followed what you did to change the "Approved" column text by added this line to the setPropertyValues function.
I used your getCustomPropertyValue function to retrieve the organization value from the 'prevaluesOrg' variable containing the JSON data.
is working on a reply...