0
我正嘗試在我的移動應用上使用kendo ui移動框架。我必須在listview中動態地創建按鈕,並且還要在click函數上創建按鈕。Kendo UI移動按鈕
如果我在html body中寫入,一切正常,並且按鈕功能正常。
<ul data-role="listview" data-style="inset" id="genericListView">
<li>
<input type="text">sample
<a data-align="right" data-role="button" data-click="browse" id="browse"></a>
</input>
</li>
</ul>
,但如果我寫象下面這樣:
$('#genericListView').append('<li id="' + result[i].ListItemID + '"><input name="' + result[i].ListItemElementText + '"type="' + result[i].ListItemElementType +
'" id="' + result[i].ListItemElementID + '">' + result[i].ListItemElementText + '<a data-align="left" data-role="button" id="' + result[i].ListItemElementBrowsableID +
'" data-click="' + funcName + '"></a></input></li>');
按鈕好像在屏幕上,當然點擊功能的標籤不工作。
我也試圖與
1,輸入和按鍵標籤(不工作)
使用了document.createElement創建按鈕添加按鈕,也試過的setAttribute(不工作)
$('ul')。listview('refresh'); (追加,不工作)
.trigger('create'); (追加後,不工作)
我認爲這是錯誤的android css(在kendoui移動框架),因爲它正確地在iOS設備上工作。任何想法如何解決這個問題?還是我想念什麼?
輸入元素不能有子元素。驗證您的HTML。 –