Comments (8)
Hello,
I don' know what you exactly mean by "extend". But any directive inside the smart-table directive can access the table API, it means :
-the built in directives that you can modify if you want (in Directives.js
)
-any directive you associate to a cell template (using cellTemplateUrl
property for example)
If you want a running example, you can go on the demo site.
Please note on the custom.js tab
- the
require: '^smartTable'
which means that the directive expect to find in its parent element the directive smartTable ( - the link function has a parameter ctrl wich is a reference to the table controller.
for more information about directive controller you can see the documentation
cheers,
Laurent
from smart-table.
Thanks, when I add a new directive to Directives.js with require: ^smartTable i get an error saying cant find smartTable controller
from smart-table.
because your directive must have a parent elment in the markup wich has the 'smart-table' directive.
So it must be either one the directives you see in the table template, or one you will insert thanks to the cellTemplateUrl
of your column config.
I suggest you watch [https://github.com/lorenzofox3/Smart-Table/blob/master/smart-table-module/partials/smartTable.html](this video), this explains what is a directive controller
Laurent
from smart-table.
Ah I understand now, thanks. Apologies I am very new to angular and still getting my head around directives.
from smart-table.
no problem
from smart-table.
Hi @lorenzofox3 I'd love to access the ctrl
in the smartTableDataCell directive (which I'm trying to customize). But it comes up undefined. Probably an obvious thing I don't understand??
Thanks.
from smart-table.
Hi,
As mentioned on the developer guide, you have to ask for it in your directive using the require property :
return {
require: '^smartTable',
link: function (scope, element, attr, ctrl) {
}
};
Laurent
from smart-table.
Ahh. Thanks a ton. I'm getting a kick out of forking your project. Learning a lot from it.
from smart-table.
Related Issues (20)
- Natural sort of alpha numeric string HOT 1
- st-sort-default="true" is not working fine with custom sort HOT 6
- st-ratio can not be declared as a function HOT 1
- st-sort-default="true" not working when table first loads. HOT 2
- Delete row after searching HOT 1
- When I debug st-table safeCopy object it returns empty array. HOT 1
- sever side pagination
- Paginated data updates HOT 1
- Angularjs plugin smart table st-search through random text entered like datatablejs search HOT 7
- get filter date in table using start and end date in angular 5 HOT 1
- Smart table with two custom date filters HOT 1
- Virtualisation feature
- Manipulate the current page within a controller for pagination
- Serverside pagination issue
- Smart table documentation website melts my computer HOT 1
- aria-sort order is wrong
- Question: how to programmatically go to a specific page?
- Custom filtering on single column HOT 1
- How to pass argument with st-pipe
- st-sort does not work when start with number.
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 smart-table.