Skip to content

Commit

Permalink
Modifications (#11)
Browse files Browse the repository at this point in the history
* updated

* updated

* updated

* updated

* updated (#5)

* updated

* updated

* updated

* updated

* merged pull request

* merged pull request

* restructured to include tests

* updated

* updated

* updated

* updated

* updated bug

* updated

* bug

* updated footdata

* updated

* updated

* updated

* updated

Co-authored-by: Pankaj Jain <[email protected]>
  • Loading branch information
Terminator9530 and thehitechpanky authored Jun 17, 2020
1 parent 92effad commit fa1e816
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Bootstrap

# CDN

<script src="https://cdn.jsdelivr.net/gh/TaxHeal-in/js-bootstrap-tables@0.2.9/src/html.js"></script>
<script src="https://cdn.jsdelivr.net/gh/TaxHeal-in/js-bootstrap-tables@0.2.9/src/table.js"></script>
<script src="https://cdn.jsdelivr.net/gh/TaxHeal-in/js-bootstrap-tables@0.3.0/src/html.js"></script>
<script src="https://cdn.jsdelivr.net/gh/TaxHeal-in/js-bootstrap-tables@0.3.0/src/table.js"></script>

# How to use

Expand Down
4 changes: 2 additions & 2 deletions sample/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

<body>
<div id="tableDiv"></div>
<script src="https://cdn.jsdelivr.net/gh/TaxHeal-in/js-bootstrap-tables@0.2.9/src/html.js"></script>
<script src="https://cdn.jsdelivr.net/gh/TaxHeal-in/js-bootstrap-tables@0.2.9/src/table.js"></script>
<script src="https://cdn.jsdelivr.net/gh/TaxHeal-in/js-bootstrap-tables@0.3.0/src/html.js"></script>
<script src="https://cdn.jsdelivr.net/gh/TaxHeal-in/js-bootstrap-tables@0.3.0/src/table.js"></script>
<script src="main.js"></script>
</body>

Expand Down
2 changes: 2 additions & 0 deletions sample/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ let newDynamicTable = new DynamicTable({
head2Row,
footRow,
functionArray,
addRowCount:true,
addHeadDataAtBottom:true,
addFilter: true,
addLimit: true,
addCheckboxes: true,
Expand Down
18 changes: 12 additions & 6 deletions src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class DynamicTable {
head2Data,
footData,
addFilter,
functionArray
functionArray,
addHeadDataAtBottom
} = this.paramObject;
if (addFilter) {
this.divNode.appendChild(this.filterNode);
Expand All @@ -41,7 +42,9 @@ class DynamicTable {
if (footData) {
this._addTableDivision(tableNode, `tfoot`, footData);
} else {
this._addTableDivision(tableNode, `tfoot`, headData, head2Data);
if(addHeadDataAtBottom){
this._addTableDivision(tableNode, `tfoot`, headData, head2Data);
}
}
return this.divNode;
}
Expand Down Expand Up @@ -204,7 +207,7 @@ class DynamicTable {
_addTableDivision(tableNode, divisionName, dataArray, dataArray2) {
let {
addCheckboxes,
checkboxClass
checkboxClass,
} = this.paramObject;
let divisionNode = this._getNode(divisionName);
tableNode.appendChild(divisionNode);
Expand Down Expand Up @@ -245,7 +248,8 @@ class DynamicTable {
let {
dataRows,
addFilter,
addLimit
addLimit,
addRowCount
} = this.paramObject;
let filterTerm;
if (addFilter) {
Expand Down Expand Up @@ -274,8 +278,10 @@ class DynamicTable {
}
});
this._clearNode(this.countNode);
let textNode = document.createTextNode(`Showing 1 to ${limitNumber} of ${serialNumber} entries`);
this.countNode.appendChild(textNode);
if(addRowCount){
let textNode = document.createTextNode(`Showing 1 to ${limitNumber} of ${serialNumber} entries`);
this.countNode.appendChild(textNode);
}
}

_attachFunctionToClassNodes(baseNode,className, eventName, functionName) {
Expand Down

0 comments on commit fa1e816

Please sign in to comment.