spatie / blender-js

Blender JavaScript files
MIT License
16 stars 2 forks source link

Replace datatables #14

Closed sebastiandedeyne closed 6 years ago

sebastiandedeyne commented 7 years ago

Find an alternative library

freekmurze commented 7 years ago

Vuetiful seems nice

Some alternatives: http://www.rent-a-hero.de/wp/wp-content/uploads/2017/04/vuegrid/

freekmurze commented 7 years ago

Thinking about the how a simple home grown component could be used.

@sebastiandedeyne @willemvb What are your thoughts on this?

<SortableTable rows="{{ $rowsJson }}" sort-on="name, desc">
   <SortableColumn name="name" field="name"></SortableColumn> 
   <SortableColumn name="Publicatie" field="publishDate", data-type="date:Y:m:d" filter="false"></SortableColumn> 
   <SortableColumn sortable="false" filter="false">
      <slot scope="row"> 
         @{{ row.deleteLink }} @{{ row.anotherLink }}
      </slot>
   </SortableColumn>   
</SortableTable>
sebastiandedeyne commented 7 years ago

Naming nitpicks:

sort-on => sort-by + sort-order data-type => datatype filter => filterable

When adding an a tag to name to link to the detail page, how will we ensure it doesn't include the html when filtering?

freekmurze commented 7 years ago

When adding an a tag to name to link to the detail page, how will we ensure it doesn't include the html when filtering?

Maybe with a little bit of magic? Let's parse all the fields if any of them contain a link, just use the content between the tags.

sebastiandedeyne commented 7 years ago

That should do the trick!

Maybe we could add a url option too, so we don't need to write our own a tag.

<SortableColumn name="name" url="editUrl" field="name"></SortableColumn>
willemvb commented 7 years ago

Random thoughts:

<records data="{{ $json }}" sort-by="name">
    <field label="Online" filter-by="status === 'online' ? 1 : 0" >
        <img src="{status}.png">
    </field>
    <field label="Title" value="name"></field>
    <field sortable=false filterable=false label="Price" value="price + ' €' " class="field-numeric"></field>
</records>
freekmurze commented 7 years ago

Basic Idea is that this component should just work for us with a minimal amount of configuration.

sebastiandedeyne commented 7 years ago

Words: catalog, index, directory, listing.

...They all suck though.

freekmurze commented 7 years ago

ShittyTable 😁

freekmurze commented 7 years ago

Maybe TableView? Not too long, sounds kinda friendly. There must be a better name still though...

spatie-bot commented 6 years ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.