Page 1 of 2

Radio Button in List

Posted: Sat May 18, 2013 3:11 pm
by Joe Bohen

Hi,

I have a list which is populated from an Appery database service. I wish to include a yes/no radio button on each of the list items that is independent of all the other list items radio buttons. Is this possible? if not can you suggest an alternative method of achieving this. I have tried a toggle button but this looses the label values when used in the list view.

Regards,
Joe


Radio Button in List

Posted: Sat May 18, 2013 6:12 pm
by Illya Stepanov

Hi Joe - working on it. We'll update.


Radio Button in List

Posted: Sat May 18, 2013 8:37 pm
by maxkatz

If you are asking whether you can insert a radio button inside the list -- the answer is yes. Was your question about something else?

Image


Radio Button in List

Posted: Sun May 19, 2013 10:08 am
by Joe Bohen

Hi Max,

My list is exactly as yours with the addition of toggle switch which I also have problems with, the on and off label text have been changed in the designer but this does not populate to the form. when changing a radio button on one list item all the other radio buttons on other items are changed to the same value. I have shared the app to support.

regards,
Joe


Radio Button in List

Posted: Sun May 19, 2013 7:46 pm
by maxkatz

I'm not 100% sure I understand what happens.. could you post screen shots?


Radio Button in List

Posted: Sun May 19, 2013 9:41 pm
by Joe Bohen

Image

The labels on the toggle switch are set to Yes/ No on the settings tab. But when the application launches the labels read On/OFF.

Image

Yes is selected on the the screen shot above, but when No is selected on the second list item the first list item reverts to unselected.

Image


Radio Button in List

Posted: Mon May 20, 2013 10:29 am
by Maryna Brodina

Hello!

But when the application launches the labels read On/OFF-- it's a bug. This should help https://getsatisfaction.com/apperyio/...

when No is selected on the second list item the first list item reverts to unselected -- the problem is that all radio buttons have the same name. To change that on service success (service where you map results) add the following code:
code$('[name=mobileradiogroupName]').each(function () {
var $this = $(this);
name = $this.attr('name');
if (name) {
$this.attr('name', name + $this.attr('_idx'));
}
});/code
where mobileradiogroupName - name of mobileradiogroup

But if you've added any actions on mobileradiogroup - they won't work. You would need to bind them to new names. For example to bind event "Value change" mobileradiogroup on service success event add the following code:
code$('input[name^="mobileradiogroupName"]').die().live({
change: function() {
//here is your code
}
});/code
where mobileradiogroupName - mobileradiogroup name.
Also if somewhere in your programm you used selector [name=mobileradiogroupName] you can't use it now. For example in function on "Value change" event described above you can use "this". In this variable you pass element where event occured. For example use code $(this).val()/code to get value of mobileradiogroup which was changed.


Radio Button in List

Posted: Mon May 20, 2013 4:26 pm
by Joe Bohen

Hi Marina, Thanks for your code I managed to get the toggle switch to behave as required.


Radio Button in List

Posted: Tue May 21, 2013 8:27 pm
by Joe Bohen

Hi Marina,

Everything is working great apart from the list is losing its custom styling. In more properties for the optiongroup I add settings which work on the developer but not on the exported application.

Image

I would also like to style the list like a banner and have attempted applying custom css but have not been successful could you advise me on how to achieve this please.

Regards,
Joe


Radio Button in List

Posted: Tue May 21, 2013 9:16 pm
by Kateryna Grynko

Hi Joe,

On what device do you test exported app?

As for Mobile List stilization - you can create create theme here: http://jquerymobile.com/themeroller/i...