我正在嘗試在頁面中插入一個控件組小部件,但是當我呼叫controlgroup()時,重排是不正確的。所有預期的按鈕都顯示爲鏈接(Chrome 38.0.2125.101 m)。jQuery-Mobile controlgroup does not render
我假設這是我正在做的事情,而不是一個錯誤,因爲演示似乎很好地工作。我錯過了一個步驟嗎?
這裏是我的示例代碼: http://jsfiddle.net/Lwr4mm4v/5/
function Body() {
this.left_buttons = $('<div data-role="controlgroup"></div>').appendTo('div');
this.save_button = $('<a href=# data-role="button" id="save">save description</a>').appendTo(this.left_buttons);
this.run_button = $('<a href=# data-role="button" id=\"exec\">run description</a>').appendTo(this.left_buttons);
this.stop_button = $('<a href=# data-role="button" id=\"stop\">stop description</a>').appendTo(this.left_buttons);
this.add_button = $('<a href=# data-role="button" id="add">add state</a>').appendTo(this.left_buttons);
this.left_buttons.controlgroup();
}
var test = new Body();
感謝
我還是couldn不能用.trigger(「create」)渲染它,但是,移到1.4.0就可以解決這個問題。謝謝! – devanl 2014-10-30 12:54:30
@devanl我會延續我的回答。不過,我建議使用最新版本的JQM。 – Omar 2014-10-30 12:55:23