Multiple tables javascript errors
Multiple tables javascript errors
TreeUK
Posts: 3Questions: 0Answers: 0
Great plugin, thought I'd report an issue I can repeat.
Basically if your tbody doesn't contain the same number of tds as you have ths or you use colspan on more than one table, the plugin dies on the second table.
This seems to be because colspan is only supported on one table:
Both empty cells = win.
One colspan, one empty cells (either order) = fail.
Both colspans = fail.
[code]
Type
Title
Url
Description
Live
<% if(Model.Count == 0) { %>
No stuff has been added yet
<% } %>
<% else { %>
<% foreach(var col in Model) { %>
<%: col.Type %>
<%: col.Title %>
<%: col.Url%>
<%: col.ShortDescription.GetFirstNCharactersFromString(20)%>
<%: col.Live%>
<% } %>
<% } %>
Type
Title
Url
Description
Live
[/code]
Obviously I'm only showing one table here but both tables vary only in the content and number of cells per row. This example is 6, the other is 4.
Basically if your tbody doesn't contain the same number of tds as you have ths or you use colspan on more than one table, the plugin dies on the second table.
This seems to be because colspan is only supported on one table:
Both empty cells = win.
One colspan, one empty cells (either order) = fail.
Both colspans = fail.
[code]
Type
Title
Url
Description
Live
<% if(Model.Count == 0) { %>
No stuff has been added yet
<% } %>
<% else { %>
<% foreach(var col in Model) { %>
<%: col.Type %>
<%: col.Title %>
<%: col.Url%>
<%: col.ShortDescription.GetFirstNCharactersFromString(20)%>
<%: col.Live%>
<% } %>
<% } %>
Type
Title
Url
Description
Live
[/code]
Obviously I'm only showing one table here but both tables vary only in the content and number of cells per row. This example is 6, the other is 4.
This discussion has been closed.
Replies
Although the table renders with the sorting icons, there's still a javascript error if you use colspan AT ALL.
Allan