This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
forked from onechiporenko/ember-models-table
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from C2FO/c2fo
C2fo
- Loading branch information
Showing
6 changed files
with
196 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/dummy/app/routes/examples/server-table-default-columns.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Ember from 'ember'; | ||
import generateContent from '../../utils/c'; | ||
|
||
export default Ember.Route.extend({ | ||
|
||
model() { | ||
return this.get('store').query('user', {}); | ||
}, | ||
|
||
setupController(controller) { | ||
|
||
controller.set('otherData', generateContent(10)); | ||
controller.set('defaultColumns', [ | ||
//id | ||
'index', | ||
'firstName', | ||
{propertyName: 'lastName', title: 'Family Name', className: 'text-success'}, | ||
]); | ||
|
||
return this._super(...arguments); | ||
} | ||
|
||
}); |
24 changes: 24 additions & 0 deletions
24
tests/dummy/app/templates/examples/server-table-default-columns.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h4>`models-table-server-paginated` example</h4> | ||
<p>Component is extended into the `my-server-table` (see <code>tests/dummy/app/components/my-server-table.js</code>)</p> | ||
<p>Another way to setup your table is to provide the default</p> | ||
</div> | ||
<div class="col-md-8"> | ||
{{! models-table data=otherData defaultColumns=defaultColumns}} | ||
{{my-server-table data=model defaultColumns=defaultColumns}} | ||
</div> | ||
<div class="col-md-4"> | ||
<p>Component usage:</p> | ||
<pre><code class="handlebars">\{{my-server-table | ||
data=model defaultColumns=defaultColumns}}</code></pre> | ||
<p><code>defaultPropertyNames</code>:</p> | ||
<pre><code class="javascript">{{to-string this 'defaultColumns'}}</code></pre> | ||
|
||
<p><code>model</code>:</p> | ||
<pre><code class="javascript">{{to-string this 'model.toJSON()'}}</code></pre> | ||
|
||
<p><code>data</code>:</p> | ||
<pre><code class="javascript">{{to-string this 'otherData'}}</code></pre> | ||
</div> | ||
</div> |