arturadib / agility

Javascript MVC for the "write less, do more" programmer
http://agilityjs.com
MIT License
542 stars 70 forks source link

Radio with different parents #71

Open fdettoni opened 12 years ago

fdettoni commented 12 years ago

Hi,

I was trying to use agility to set a radio checked in a set of radios in different parents, but it doesn't work because the use of siblings function on line 543 of agility.js. So I was wondering if there is any reason to not accept radios with different parents.

I'm using the example above, where the option "a" is not checked on start:

var obj = $$(
  {opt:'opt-a'},
  "<div> \
        <ul> \
      <li> \
    <input type='radio' name='test' value='opt-a' data-bind='opt'>a</input> \
      </li> \
      <li> \
        <input type='radio' name='test' value='opt-b' data-bind='opt'>b</input> \
      </li> \
    </ul> \
        You selected: <span data-bind='opt'/> \
   </div>"
);
$$.document.append(obj);