ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Add Awesome Controls Dynamically
Title:
B
I
{code}
?
I want to add awesome controls dynamically: for example: in view in have a table: <table id="tbldynamicadd"></table> Auto Complete control: @(Html.Awe().Autocomplete("Categories").Url(Url.Action("Getvalues", "AutoController"))) download function(){ $("#tbldynamicadd> tbody").html(""); $.ajax({ ****ajax call*** }, success: function (data) { for (i = 0; i < data.length; i++) { var item = data[i]; var row = "<td align='center' > ****Want to add AutoComplete Control here**** </td>"; var newrow = $(row); $("#tbldynamicadd").append(newrow); } } }); }
Save Changes
Cancel
warlok
asked at 21 Mar 2016
Answers
B
I
{code}
?
this works in the demo: <div id="test1"></div> <script> $(function () { @{ var str = Json.Encode(Html.Awe().Autocomplete("MealTest").Controller("MealAutocomplete").ToString()); } var str = @Html.Raw(str); $('#test1').html(str); }); </script> you could also set the name to something like #Name and use it as a format by calling in js str.replace('#Name', 'MealTest');
Save Changes
Cancel
Omu
answered at 22 Mar 2016
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK