@@ 152-165 (lines=14) @@ | ||
149 | * @return $this |
|
150 | * @see https://datatables.net/reference/option/order |
|
151 | */ |
|
152 | public function orderBy($index, $direction = 'desc') |
|
153 | { |
|
154 | if ($direction != 'desc') { |
|
155 | $direction = 'asc'; |
|
156 | } |
|
157 | ||
158 | if (is_array($index)) { |
|
159 | $this->attributes['order'][] = $index; |
|
160 | } else { |
|
161 | $this->attributes['order'][] = [$index, $direction]; |
|
162 | } |
|
163 | ||
164 | return $this; |
|
165 | } |
|
166 | ||
167 | /** |
|
168 | * Order Fixed option builder. |
|
@@ 175-188 (lines=14) @@ | ||
172 | * @return $this |
|
173 | * @see https://datatables.net/reference/option/orderFixed |
|
174 | */ |
|
175 | public function orderByFixed($index, $direction = 'desc') |
|
176 | { |
|
177 | if ($direction != 'desc') { |
|
178 | $direction = 'asc'; |
|
179 | } |
|
180 | ||
181 | if (is_array($index)) { |
|
182 | $this->attributes['orderFixed'][] = $index; |
|
183 | } else { |
|
184 | $this->attributes['orderFixed'][] = [$index, $direction]; |
|
185 | } |
|
186 | ||
187 | return $this; |
|
188 | } |
|
189 | ||
190 | /** |
|
191 | * Set orderMulti option value. |