anon
Posts: 0
Joined: Sun Apr 13, 2014 12:10 am

Appery functions, and Group Button selection

Can someone explain to me how I would report the selected button on the group button element? I am trying to mock up a javascript solution to prepare my JSON filtering query, and I am having difficulty finding my way around the Appery JS.

What types of functions can I call from Appery('element').____()?
I have used:
Appery('element').val(), and
$('input', Appery("checkbox")).prop("checked").

I have a group of buttons and I want to record the value of the selected button of the group element.

Help would be greatly appreciated!

Ben

anon
Posts: 0
Joined: Sun Apr 13, 2014 12:10 am

Appery functions, and Group Button selection

Yes, I was looking at this... But I am quite new to Appery..

It is not of type radio it is a group button. Would the type be button or what?
Buttons are not checked, they are selected so does prop have a selected string to match?

And I am not trying to refresh buttons or select them automatically. I want to add the selected button's text to a variable. Code would help me very much as I am new to this...

Also where can I find all of the Appery(). functions? I tryed to explore the object that Appery() returns by logging it the console, but it is extremely convoluted and doesn't tell me anything useful.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Appery functions, and Group Button selection

Hello Benjamin,

Button group is not used to chose something in common use.

But you can use it if your app logic requires it.

For you to know, button only make logic to "click" on it.

You have two ways to implement this logic:
ol
liAdd "click" event-handlers to all of these buttons. You can specify logic you need in these separate event handlers./li

liAdd single "click" event-handler to whole buttons group. And fill it with the following code: http://prntscr.com/39s3yw/direct/li
precode
var button = jQuery(event.target).closest(".ui-btn");

var buttonText = button.text().trim();

var buttonName = button.attr("name");

//Using "buttonText" and "buttonName" variabels.
console.log(buttonText + " = " + buttonName);/code/pre
/ol
We suggest you use second way to implement your logic.
[quote:]
Also where can I find all of the Appery(). functions? I tryed to explore the object that Appery() returns by logging it the console, but it is extremely convoluted and doesn't tell me anything useful.
[/quote]
In common cases Appery("component") function returns a jQuery wrap object. So you can use it like jQuery("...") object.

Regards.

Return to “Issues”