Hi all, a quick question about rendering form elements.
I want to render JSON data to the form elements i) text inputs and ii) select drop downs. But I can't find a workable directive for either of these 2 cases. I've searched the mailing list and dug into the documentation, but can't seem to find an answer. So my HTML, data, and directives look like A), B), and C) respectively. If I try to render it with D), I get nothing with the text input, and the dropdown list gets replaced with just a string value.
A)
<div class='account_container'>
<div class='account_content'>
<div>
<label>Name</label>
<input id='account-text-input' type='text' />
</div>
<div>
<label>Category</label>
<select id='account-select-dropdown'>
<option value='asset'>asset</option>
<option value='liability'>liability</option>
<option value='revenue'>revenue</option> <option value='expense'>expense</option>
</select> </div>
<div> <input type='button' value='ok' />
<input type='button' value='cancel' /> </div>
</div> </div>
B) {
counterWeight: "debit", id: "revenue",
name: "revenue", tag: "account",
type: "revenue" }
C)
accountDirective: {
"#account-text-input": "some.value",
"#account-select-dropdown": "<?howto-select_from-existing-list?>",
}
D)
$('.account_container').render(myModel, accountDirective)
Is there a straight forward way of doing this? I can hack together a render with JQuery. BUt I much prefer the elegant line D) if I can get it.
Thanks in advance
Tim Washington