You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReactDatatable is a component which provide ability to create multifunctional table using single component like jQuery Datatable. It's fully customizable and easy to integrate in any react component. Bootstrap compatible.
@@ -130,6 +140,35 @@ class App extends Component {
130
140
}
131
141
]
132
142
}
143
+
this.extraButtons=[
144
+
{
145
+
className:"btn btn-primary buttons-pdf",
146
+
title:"Export TEst",
147
+
children:[
148
+
<span>
149
+
<i className="glyphicon glyphicon-print fa fa-print" aria-hidden="true"></i>
150
+
</span>
151
+
],
152
+
onClick:(event)=>{
153
+
console.log(event);
154
+
},
155
+
},
156
+
{
157
+
className:"btn btn-primary buttons-pdf",
158
+
title:"Export TEst",
159
+
children:[
160
+
<span>
161
+
<i className="glyphicon glyphicon-print fa fa-print" aria-hidden="true"></i>
162
+
</span>
163
+
],
164
+
onClick:(event)=>{
165
+
console.log(event);
166
+
},
167
+
onDoubleClick:(event)=>{
168
+
console.log("doubleClick")
169
+
}
170
+
},
171
+
]
133
172
}
134
173
135
174
editRecord(record) {
@@ -147,6 +186,7 @@ class App extends Component {
147
186
config={this.config}
148
187
records={this.state.records}
149
188
columns={this.columns}
189
+
extraButtons={this.extraButtons}
150
190
/>
151
191
</div>
152
192
)
@@ -166,38 +206,43 @@ var ReactDatatable = require('@ashvin27/react-datatable')
166
206
## Props
167
207
| Name | Type | Description
168
208
| ------------- | ------------- | ------------- |
169
-
| config | Object[] | This props will used to specify datatable configuration
170
-
| records | Object[] | This props will used to pass records/data to datatable
209
+
| className | String | Datatable additional class, use to appy additional styling on table
210
+
| tHeadClassName | String | Additional class to be put on the "thead" of the table
171
211
| columns | Object[] | This props will used to specify datatable column configuration
212
+
| config | Object[] | This props will used to specify datatable configuration
213
+
| dynamic | boolean | This props will used to specify the table data will be server side or static
214
+
| id | String | Identifier of datatable
215
+
| records | Object[] | This props will used to table records
216
+
| total_record | Number | This props will used to specify the total records in case of table data is server side.
217
+
| onChange | Function(Object) | This method will call on table actions(page change, sorting, filtering, page length change)
218
+
| onRowClicked | Function(Object) | This method will call when user click on a row, return row object.
219
+
| extraButtons | Object[] | this props will add custom extra buttons to the table tools in the top right of the table header next to the built in export buttons
0 commit comments