-1
I have knock out section Below

<select>

   <option value="0|-1">All</option>
   <optgroup data-bind="repeat: { foreach : ViewModel.availableLists, bind : 'attr: { label :     $item().ProjectName }, foreach : $item().Lists' }">
     <option data-bind="text : ListName" />
   </optgroup>

</select>

But I want to convert this select drop down to Ul and Li, i am failing to convert this to ul and li. How can i do that?

Each optgroup should be rendered as an li with css class "project-name". Under each project-name Each option should be rendered as an li with css class "list-name".

Kuttan Sujith
  • 7,889
  • 18
  • 64
  • 95
  • Please edit your question and tell us what you've got so far, be specific about the problem you're experiencing. – Jeroen May 20 '13 at 12:03

1 Answers1

0

I think this syntax can help you to create an options groups in your binding

Also note that the <li> are automatically created by the options binding using the items in your binded model (this is the idea of the binding). You can read the knockout options binding documentation

Community
  • 1
  • 1
Yaniv
  • 144
  • 1
  • 11