javascript - Dojo and binding native select with WidgetList -


I'm trying to prepare the original selection list of data-bounds with dojo, I do not want to see the dojo widget Just plain selection, however, I am struggling to do this work

The following code "works" (this binds three elements in the array), note that I have options in the span tag Is wrapped up, which will definitely render blank selection

by any thought Can it to get, probably a completely different approach?

Code:

  & lt ;! DOCTYPE html & gt; & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; Script src = "/ script / dojo-release -1.9.3 / dojo / dojo.js" data-dojo-config = "parse download: 0, async: 1" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Function (parser, stateful, statefull array) {model = (dojo / parser "," dojo / stateful "," dojox / mvc / statefularray "," dojox / mvc / output "," dojo / domREeady! New statewide ({{names} Set value = function (value) {alert ("running": "Lars", value: 0}, {name: "per", value: 1}, {name: "ola", value: 2}]); "); This._set (" innerText ", value);}; parser.parse ();}); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Script type = "dojo / require" & gt; At: "dojox / mvc / at" & lt; / Script & gt; & Lt; Select data-dojo-type = "dojox / mvc / widgetlist" data-dojo-mixins = "dojox / mvc / _InlineTemplateMixin" data-dojo-prop = "children: model" & gt; & Lt; Script type = "dojoox / mvc / inlineateplate" & gt; & Lt; Period & gt; & Lt; Option data-dojo-type = "dojox / mvc / output" data-dojo-props = "value: at (this.target, 'name'), _setValueAttr: setValue" & gt; & Lt; / Options & gt; & Lt; / Span & gt; & Lt; / Script & gt; & Lt; / Select & gt; & Lt; / Body & gt; & Lt; / Html & gt;    

There are two tips:

  • You do not Basically specify data-dojo-type / data-do-prop in the root node of the template. In order to reduce such a limit, the data-MVC-child-type / data-MVC-child-props in the Dodgeox / MVC / Windexlist.
  • Dojo / MVC / output is useful, but you can get a similar thing through the "node mapping" feature of DigiT / _Widbage.

    here & lt; Select & gt; / & lt; Options & gt; Object Hope that it will be helpful.

    Best, - Akira

      & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Script src = "// ajax.googleapis.com/ajax/libs/dojo/1.10.1/dojo/dojo.js" data-dojo-config = "parseOnLoad: 0, async: 1" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; ({"Dojo / Parser", "Dojo / Parser", "Dojo / MVC / Stateful Array", "Dojo / Dome Readie!"), Function (Parser, Stateful, Stateful Array) {Model = New StateFullArere ({{Name: Foo "}, {name:" bar "}, {name:" falcon "}]); parser.parse ();}); & lt; / scripts & gt; & lt; / head & gt; & lt; Body: gt; & lt; script type = "dojo / require" & gt; at: "dojox / mvc / at" & lt; / script & gt; & lt; select data- dojo-type = "dojox / Mvc / widgetList "data-dojo-mixins =" ​​dojox / mvc / _InlineTemplateMixin "data-dojo-prop =" children: model "data -mvc-child-props =" _ setTextAttr: {node: 'domNode' Writer: "internal text"}, text: on (this.target, 'name') "> gt; script type =" dojoox / mvc / inlineateplate "> gt; & lt; option & gt; & lt ; / Option> gt; & lt; / script & gt; & lt; / select & gt; & lt; / body & gt; & lt; / html & gt;    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -