Comments (7)
The ColumnConfiguration
has these properties at the moment:
$name
internal name for the confiiguration$searchable
if the column should be searchable$orderabe
if the column should be orderable$callable
the function to call when the column should be evaluated
The method signature looks like this
What additional Features does the DTDataComposer
need?
from datatable.
it would be nice to have a way to pass config options to the columns array. at least the most common options
from datatable.
What do you mena exactly with config options?
Can you show some code?
from datatable.
let me show:
this is what i do now:
Datatable::table()->addColumn('One','Two','Three')
(...)
->setOptions([
'aoColumns'=>[
null,
['sWidth'=>'50%'],
['sWidth'=>'40%','sClass'=>'text-right']
]]);
this generates:
"aoColumns":[
null,
{ "sWidth":"50%" },
{ "sWidth":"40%", "sClass":"text-right" }
]
there are a number of options to customize the columns. it would be nice to be able to put those options when you define the column.
a posibility is:
public function column($name, callable $callable = null, $searchable = true, $orderable = true, $options = [])
from datatable.
Yes, I had that in mind, however, i would like to put the reponsibility into the view part of the configuration.
So a more sophisticated example could look like this:
// Generate server side configuration
$table = Datatable::make(new CollectionProvider(User::all()))
->column('id') // defaults to sortable and searchable
->column('name', function($data) { return $data->extraLongPropertyName; })
->build(); // will generate the table which now can be used to handle requests or be passed to the view.
// server side
if(Datatable::shouldHandle()) {
$table->handleRequest();
}
// client side (e.g. in view)
$table->view(Version::Datatable_1_9)
->addOption('name', ... your options)
->render()
Would that also work? I would like to clearly separate the server side from the client side.
from datatable.
I like that.
the problem i had with the old version was the need to put the whole "aoColumns" and having to put the options in order. which is a little annoying.
from datatable.
Column configuration was implemented, look over it and let me know what you think
from datatable.
Related Issues (20)
- CollectionProvider should take the individual column search settings into consideration
- `CollectionProvider` should support custom order functions
- Add Datatable 1.10 support
- [CollectionProvider] The search function should be handed the raw model
- OpenSkill does not work with symfony/http-foundation ~3.0 HOT 4
- [QueryBuilderProvider] Datatable::query ? HOT 7
- Allow http-foundation 2.8.* for better compatibility with Laravel 5.2 HOT 6
- [CollectionProvider] Returned columns are empty HOT 6
- [CollectionProvider] Sorting does not work as expected HOT 4
- Tag and Release Version 0.3.0? HOT 1
- Make VersionEngine configurable HOT 2
- Illuminate\Support\Collection::reject is not supported in collections w/ Laravel 4.2 HOT 2
- [CollectionProvider] Support pagination HOT 15
- [CollectionProvider]: Need Help HOT 4
- [General] Project abandoned? HOT 5
- Call to undefined method OpenSkill\Datatable\Datatable::table()
- Just need some info Upgrading Laravel 4 - Laravel 5.5 HOT 1
- EloquentQueryProvider HOT 3
- Laravel 4 Service Provider HOT 1
- Support DynaTable out of the box. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datatable.