2018-02-23 23:01:30 +08:00
|
|
|
# datatables
|
|
|
|
Parser for Datatables
|
2018-02-23 23:05:38 +08:00
|
|
|
|
|
|
|
# Usage
|
|
|
|
|
|
|
|
filter, err = datatables.Parse(r)
|
|
|
|
if err != nil {
|
|
|
|
//Handle error
|
|
|
|
}
|
|
|
|
|
|
|
|
# Struct
|
|
|
|
|
2018-02-23 23:07:08 +08:00
|
|
|
```
|
2018-02-23 23:05:38 +08:00
|
|
|
type Filter struct {
|
|
|
|
Draw int
|
|
|
|
Start int
|
|
|
|
Length int
|
|
|
|
Order []Order
|
|
|
|
Columns []Column
|
|
|
|
SearchValue string
|
|
|
|
SearchRegex bool
|
|
|
|
}
|
|
|
|
|
|
|
|
type Column struct {
|
|
|
|
Data string
|
|
|
|
Name string
|
|
|
|
Index int
|
|
|
|
Orderable bool
|
|
|
|
Searchable bool
|
|
|
|
SearchValue string
|
|
|
|
SearchRegex bool
|
|
|
|
}
|
|
|
|
|
|
|
|
type Order struct {
|
|
|
|
Column Column
|
|
|
|
Dir string
|
|
|
|
}
|
2018-02-23 23:07:08 +08:00
|
|
|
```
|