How to pimp the html table which is dynamicially added
How to pimp the html table which is dynamicially added
I use a bootrtrap temlplate for my asp.net webforms project. I copy and pasted the datatable section into my aspx page. After that I deleted the hardcoded table <Table>................</table>
instead I created the table in the codebehind:
Dim x3 As XmlElement = SearchService.FindAddressesBySearchtext(login, pass,
Einschlitz.Text.ToString, False)
``` Dim test As String = ConvertxmlToHTML(table1)
datatableDIV.InnerHtml = test
Page.ClientScript.RegisterStartupScript(Me.GetType, "table_function", "functiontest();", True)
As you see, the variable test is placed placed into the
<
div class="box-body" id="datatablediv" runat="server">
by datatablediv.InnerHtml = test
After that I call the functiontest() Javacscript Method shown at the end of the thread.
here is the containter from my aspx page
Data Tables
advanced tables
Data Table With Full Features
I changed it to :
``` <script type="text/javascript">
function functiontest() {
alert('Function called successfully!');
$('#Datatable1').dataTable({
"bPaginate": true,
"bLengthChange": false,
"bFilter": false,
"bSort": true,
"bInfo": true,
"bAutoWidth": false
});
}
</script>```
The html table I insert looks like exactly the same as the one which was hardcoded. But all the options like sorting the rows, searching for a special row in via a textbox,the pagination, all is missing. I dont know why, and I dont know how to add it correctly. Can you help out?