Giter VIP home page Giter VIP logo

Comments (8)

matfish2 avatar matfish2 commented on August 28, 2024 1

See #93.

from vue-tables.

PascalAnimateur avatar PascalAnimateur commented on August 28, 2024

Update: This is caused by id being UUID instead of integer. Is this something that would be easy to fix?

from vue-tables.

matfish2 avatar matfish2 commented on August 28, 2024

Wrap the parameter with quotes
deleteClassified("{id}")

from vue-tables.

PascalAnimateur avatar PascalAnimateur commented on August 28, 2024

Now I just receive the string "{id}" as a parameter to my method instead of the actual UUID value.

I've tried different ways (single quotes, escaping the quote, etc.) and still could not make this work.

Have you tried your solution? If so, could you provide a working jsfiddle please?
Wish I could be more helpful..

from vue-tables.

PascalAnimateur avatar PascalAnimateur commented on August 28, 2024

Nevermind, I got it to work outsite my main project...

from vue-tables.

PascalAnimateur avatar PascalAnimateur commented on August 28, 2024

It works for static records passed directly as an array in data attribute of the Vue instance, but not when loading the same data from a REST api in the ready function.

from vue-tables.

matfish2 avatar matfish2 commented on August 28, 2024

Add v-if to the component so it won't compile until the data is returned from the API. Something like:

<v-client-table v-if='loaded'></v-client-table>

where loaded will be set to true in the callback handling the returned data.
Alternatively, you can call this.$compile(this.$el) to compile the templates when the data is ready.

from vue-tables.

VitruxPT avatar VitruxPT commented on August 28, 2024

I did that but for some reason it doesn't work for me.
I added the v-if to only compile when the data is loaded but i still get an undefined when i try to use it with a button from my table.

My edit button:
<button type='button' class='btn btn-warning' href='javascript:void(0);' @click='$parent.Edit({viewer})'><i class='fa fa-pencil-square-o' aria-hidden='true'></i></button>

(Note: If i use an integer for example the id instead of viewer which is a string everything works and i get the id in the alert function.)

My Edit Function is just:
Edit: function (viewer) { alert(viewer); }

from vue-tables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.