Comments (4)
@cloud9business Grate! :) You could also just dynamically bind the api-url
prop to apiUrl
value.
<vuetable :api-url="apiUrl"></vuetable>
from vue-table.
Thanks for the response.
editingServiceTask.id is client side.
What seems to work is setting api-url to an empty string initially and then setting it via a computed property via the loading event.
` computed: {
apiUrl: function () {
return "/api/v1/service_tasks/" + this.editingServiceTask.id + "/items";
}
},
events: {
'vuetable:loading': function() {
if (this.$refs.serviceTaskItemsTable !== undefined){
this.$refs.serviceTaskItemsTable.apiUrl = this.apiUrl;
}
},
},`
from vue-table.
@cloud9business To me, the editingServiceTask.id
does not look like a php object! If it is a php object it should look like this editingServiceTask->id
. And the called url confirms it, because it only has opening and closing braces, excluding the value of editingServiceTask.id
itself.
Please check if editingServiceTask
is an object on your server side or the client side. If it is the object on the server side (laravel) it should be editingServiceTask->id
as I mentioned. But if it is the object on the client side, you definitely cannot use it inside blade!
Hope that helps. :)
from vue-table.
Dynamically binding the api-url property to apiUrl is the answer. Thank you @cloud9business for asking this question and showing how to set up apiUrl in computed. @ratiw we can't thank you enough for vuetable and your continued support. It's funny how we can see something a thousand times, like that little colon in front of some of the vuetable properties, and not realize the significance. It's really nice to have dynamic values in the api-url property. I'm still trying to understand how this works. Why doesn't :api-url="this.apiUrl" work? I think this refers to an instance of an object, correct? Maybe, when we're setting the properties of the vuetable it doesn't understand what object this.apiUrl is referring to which is why we need to use computed? Sorry for the newbie question.
from vue-table.
Related Issues (20)
- Search with a extra data. HOT 6
- problem with scroll HOT 1
- Demo does not work in chrome HOT 4
- Error compiling template!!!! HELP ME!!! HOT 6
- Row totals HOT 3
- Is this an expected behavior of field callback?
- Can't style my grid to fit the content or a specific column HOT 2
- How use it for laravel HOT 1
- cell class cb
- Is it possible to add/del row dynamically? HOT 1
- unable to filter dates HOT 3
- No Data Available HOT 1
- Can I apply paging on client side? HOT 2
- Loading table with pre settings like sorting and page
- The word prev is spelled with the word next by mistake
- Pagination data not being transpile by polyfill
- Can i add `data-xxx` attribute to table head field? HOT 1
- http-fetch not showing data
- how to make columns resizable?
- How to use Cursor-Pagination
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 vue-table.