Different tables which have one the same function (option) but in the different format and with different data
See original GitHub issueI really have searched but nothing found on this subject. On the one page I have these two tables:
<table
id="phones"
data-toggle="table"
data-search="true"
data-detail-view="true"
data-detail-view-icon="false"
data-detail-view-by-click="true"
data-detail-formatter="detailFormatter"
data-pagination="true"
data-url="phones.json">
<thead>
<tr>
<th data-field="name">Name</th>
<th data-field="phones">Phones</th>
</tr>
</thead>
</table>
AND
<table
id="rooms"
data-toggle="table"
data-search="true"
data-detail-view="true"
data-detail-view-icon="false"
data-detail-view-by-click="true"
data-detail-formatter="detailFormatter"
data-pagination="true"
data-url="rooms.json">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="number">Number</th>
</tr>
</thead>
</table>
In these tables I use the option detailFormatter
function detailFormatter(index, row) {
var html = []
$.each(row, function (key, value) {
html.push('<p><b>' + key + ':</b> ' + value + '</p>')
})
return html.join('')
}
if I leave as is then these tables will use this option with the same set properties that not needed me.
I need this function (option) but in the different format and with different data and for different tables, for example:
For table with ID phones
function detailFormatter(index, row) {
var html = []
$.each(row, function (key, value) {
**### Formatting For table with ID phones ###**
})
return html.join('')
}
AND
For table with ID rooms
function detailFormatter(index, row) {
var html = []
$.each(row, function (key, value) {
**### Formatting For table with ID rooms ###**
})
return html.join('')
}
this also applies to others function nameFunction(index, row)
how to divide that functions… I need this function for first table and this function for second table…
How is it to do?
thanks advance
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Creating multiple tables and table relationships - Launch School
We can split data in specialized tables that are related to one another. Such relationships include: One-to-One, One-to-Many, and Many-to-Many.
Read more >Relationships between tables in a Data Model
A relationship is a connection between two tables of data, based on one column in each. A workbook can store each piece of...
Read more >Splitting data into related tables (article) | Khan Academy
Basically a single table is good when data is one-to-one. When you have thousands of rows and columns of data, where the data...
Read more >A SQL join on multiple tables: overview and implementation
Joins are used to combine the rows from multiple tables using mutual columns. As an example, assume that you have two tables within...
Read more >How to change Excel table styles and remove table formatting
Here's another way: 1. Convert your data into a table. The default table style will be applied messing up your formatting, but you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your welcome 😃
Im not sure what do you need then, you can define per table different function(name)s. Example: https://live.bootstrap-table.com/code/UtechtDustin/3493