xt-bind and form containing input and select elements

Discuss anything that's related to the Raxan framework

xt-bind and form containing input and select elements

Postby sfritsch » Sun Apr 17, 2011 9:08 pm

Hello everyone,

first I have to say thank you for developing Raxan Framework. I really like your interaction-driven concept.

Based on the Editable List Items example (http://raxanpdi.com/sdk/examples/exampl ... d=editable) I developed an editable list containing select (drop-down) html elements. But I was not able to get the values of input and select if using xt-bind, e.g.
<a href="#"><img class="save" xt-bind="click,saveData,#data input" src="views/images/accept.png" /></a>

My current solution is to add for each select element one corresponding input-hidden element. Additionally I register a blur event which copies the value of each select element to the input-hidden element.

My question is if there is another way which might more elegant?

Sebastian
sfritsch
 
Posts: 2
Joined: Sun Apr 17, 2011 5:44 pm

Re: xt-bind and form containing input and select elements

Postby raymond » Tue Apr 19, 2011 2:14 am

Hi Sebastian,

first I have to say thank you for developing Raxan Framework. I really like your interaction-driven concept.


Many thanks and welcome to the Raxan Community Forum.

I was not able to get the values of input and select if using xt-bind, e.g.
<a href="#"><img class="save" xt-bind="click,saveData,#data input" src="views/images/accept.png" /></a>


I think the issue might be related to the "#data input" css selector that you're using. Try changing that to ""#data :input", where #data is the id of the form or div container. The ":input" selector will include your select and textarea elements.

Let me know if this works for you.

Another solution would be to use xt-delegate on the container:

<ul xt-delegate="a.edit click,edit; a.save click,save,#data :input; a.cancel click;">
....
</ul>


__
Raymond
raymond
Site Admin
 
Posts: 215
Joined: Tue Mar 17, 2009 5:04 am

Re: xt-bind and form containing input and select elements

Postby sfritsch » Tue Apr 19, 2011 9:06 pm

Hi Raymond,

"#data :input" worked like a charm. Thank you very much.

Sebastian
sfritsch
 
Posts: 2
Joined: Sun Apr 17, 2011 5:44 pm


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron