Я использую шаблон underscore.js для загрузки моих данных html, где я использовал роли и классы данных jquery в самом шаблоне. Но в отличие от других элементов html, где я использовал данные jouery-роли и классы, шаблон при визуализации doesnt выглядит как другие jquery-виджеты.
Это используемый шаблон.
<div data-role="fieldcontain" class="populate-category-input">
<input name="" id="populate-category-input-id" placeholder="category" value="<%-category%>"
type="text" data-mini="true" disabled="disabled">
<label><%-category%></label>
</div>
<div data-role="fieldcontain" class="populate-amount-input">
<input name="" id="populate-amount-input-id" value="<%-amount%>" type="text"
data-mini="true" disabled="disabled">
<label><%-amount%></label>
</div>
<div data-role="fieldcontain" class="populate-description-input">
<input name="" id="populate-description-input-id" placeholder="description" value="<%-description%>"
type="text" data-mini="true" disabled="disabled">
<label><%-description%></label>
</div>
<a id="populate-edit-id" data-role="button" data-inline="true" href="#" data-icon="edit"
data-iconpos="notext" class="reset">
</a>
<a id="populate-delete-id" data-role="button" data-inline="true" href="#" data-icon="delete"
data-iconpos="notext" class="done">
</a>
Пожалуйста помоги.
Вы используете jQuery Mobile. Aftet вы предоставляете шаблон, который вы должны инициировать create
способа страницы
$("#pageid").trigger('create')
Таким образом, ваши виджеты будут инициализированы.