yep that helped also moved it to its own json object:
leftStyle: {backgroundColor: '#000000'}
and self.leftStyle.backgroundColor = data[0];
does the trick. Thank you
Best posts made by vinnyc
-
RE: Dynamically change background color
Latest posts made by vinnyc
-
RE: Tips for working with dates
Thanks again, this is giving me some ideas on where to go. I may just do the conversion on the service calls, instead of using two models.
-
RE: Tips for working with dates
@dobbel Thanks I’ve seen and am using it, to do the whole conversion to different formats. My question was more about if my model uses only dates, then the v-model binding of q-date can’t be applied to the model itself correct? I did not see any way to do this, besides adding a string version of the date to my model, which I would like to avoid.
I guess what I was hoping is a hook to allow the value shown on the date field to be parsed/formatted before modifying the model or reading from it. It this is not possible then I guess doing all the conversion before insert/read is the only way right?
-
Tips for working with dates
Hi folks, just looking for some general advices when working with dates. I get its painful in any language/framework, but perhaps someone could share some good practices.
I’m using q-date, and to my understanding dates have to be a String right? I was storing them on yyyy-mm-dd at mongodb just to make it sortable, but I need to present in dd/mm/yyyy. It became a real nightmare trying to do conversions back and forth from model to view and back.
I was thinking and moving all dates on mongodb to be real Date() objects, but then the q-date object would not work. Is there a way to work around this to work with javascript Date() objects?
My last resort would be store everything on the model as strings on the right locale, and transform them before insertion and deserialize on reads, but that also seems a bit overwhelming.
Open to any suggestions here.
Cheers
-
RE: Help with QTable and server side pagination
I found the culprit, but am not sure why, would be good if someone posts here the reason so others could benefit from this.
my
getPatients
method was using thepagination
variable directly, the moment I changed it to use a version that wrapped it under aprops
object and not refer the pagination directly it worked again.Not sure why is that, but at least its working now
-
RE: Help with QTable and server side pagination
I have updated to the latest 1.15.7 and the problem still persists. I put a breakpoint before the server side method is called for the sync and I can see that regardless of change on the pagination control (page, size) the
pagination
object remains immutable, hence the server is always fetching using the values set at the page creation.Anyone else seeing this?
-
Help with QTable and server side pagination
Hi there, I’m missing something obvious but I can’t get the pagination to work. The results are rendered, but when I click on the arrows for next page. I can see that the method @request is invoked, but the pagination.pageNumber does not increase, the server side function is still receiving page 1.
<q-table :title="$t('patient.record.title')" :data="patients" :columns="columns" :pagination.sync="pagination" @request="getPatients" row-key="_id" @row-click="selectRow" :loading="loading" > data () { return { patients: [], loading: true, pagination: { sort: "asc", descending: false, page: 1, rowsPerPage: 25, rowsNumber: 100 }, columns: [ { name: 'name', required: true, field: 'name', label: 'Nome', align: 'left', sortable: true }, { name: 'city', required: true, field: 'city', label: 'Cidade', align: 'left', sortable: true }, { name: 'birthdate', required: true, field: 'birthdate', label: 'Nascimento', align: 'left', sortable: true } ] } } getPatients () { service.listPatients({ query: {}, page: this.pagination.page, limit: this.pagination.rowsPerPage }).then(res => { this.pagination.rowsNumber = res.total this.pagination.page = res.page this.patients = res.items this.loading = false }).catch(err => { this.loading = false }) }
What am I missing to increase the pagination.page value?
Thank you
-
RE: Dynamically change background color
yep that helped
also moved it to its own json object:
leftStyle: {backgroundColor: '#000000'}
andself.leftStyle.backgroundColor = data[0];
does the trick. Thank you -
Dynamically change background color
Hi folks, is this possible if one is not using themes? I want to change the background colors of my left/right drawers:
<q-drawer show-if-above v-model="left" side="left" bordered :content-style="{'background-color' : leftColor}"> <!-- drawer content --> </q-drawer> <q-drawer show-if-above v-model="right" side="right" bordered :content-style="{'background-color' : rightColor}"> <!-- drawer content --> </q-drawer> data: function () { return { version: QMediaPlayer.version, left: false, right: false, leftColor: "#000000", rightColor: "#000000", ... methods: { onTimeUpdate(currentTime, remaining) { axios.get("/color?time="+currentTime).then(function(response){ let data = response.data; this.leftColor = data[0]; this.rightColor = data[1]; }); }
But the drawers are not updating (the http call is working as expected and I can see the variables changing but the components do not update. Is there a way to do this?
Thank you
-
RE: q-video events
Thank you all for the help. @Hawkeye64 yes from my understanding of youtube’s api that’s the method, but looks like you need to register for the event to be propagated.
-
RE: q-video events
Well at least the method never gets called for things like play/pause/volume change, which is what I was expecting, maybe I misunderstood the OnStateChange method?