@boikom
@boikom
Forum Replies Created
-
AuthorPosts
-
August 28, 2019 at 8:22 am in reply to: grid with css height auto and add new row fails to display rows after ~3 adds #100256
admin
KeymasterHi,
New Update: The reported behavior of the Grid is resolved in ver. 4.3.0.
Regards,
Boyko Markov
Smart Html Elements Team
https://www.htmlelements.com/August 27, 2019 at 7:45 am in reply to: grid with css height auto and add new row fails to display rows after ~3 adds #100253admin
KeymasterThank you!
Still persists ifediting.batch == true
also holds though.
https://codepen.io/cetinsert/pen/rNBmxBK (marked !!)admin
KeymasterOh, I am infinitely delighted to hear that!
I have an app that is now stuck at 4.1 due to this.
<hr />
https://codepen.io/cetinsert/pen/jONmPNQ?editors=1011 has just been updated with
notes on the 4.2 regressions (version 3.1 through 4.2, marked !!) of- behavior – marked 0, 2, 4
- data type – marked T
Thank you!
admin
KeymasterWe will reconsider this. The change was about the fact that data was not appropriate for form post, but we can expose a new property for that.
admin
Keymaster( https://www.htmlelements.com/docs/view-model-binding/ has sections about grid stack layout at the end of the page. )
admin
KeymasterI honestly found it was truly magical that I could just assign to arbitrarily nested app.data subfields and the view would just update live before my eyes.
That was something no other framework has.
If this sudden change is not for a deep technical reason, I would like to kindly ask the person/team behind the data binding feature to reconsider adding support for this back.admin
KeymasterI have updated the link with whole-object set.
Still, how can I read app.data.details.subject with its non-string value type?admin
KeymasterHi Cetin,
app.data is an Object. This is not a regression. It is by design. If you want to set the data, you will need to set the entire object.
Regards,
George
Smart HTML Elements
https://www.htmlelements.comAugust 27, 2019 at 5:33 am in reply to: Smart.App data binding smart-model='reference' vs value='{{reference}}'' #100243admin
KeymasterHi Cetin,
It’s better to use {{value}} for declarative rendering only. The smart-model also determines automatically the component type and binds it as the bound property could not be ‘value’, it could be ‘selectedValues’ for lists, ‘checked’ for checkboxes and radio buttons.
Best Regards,
George
Smart HTML Elements
https://www.htmlelements.comAugust 26, 2019 at 2:22 pm in reply to: grid with css height auto and add new row fails to display rows after ~3 adds #100237admin
KeymasterHi,
Update: The reported behavior of the Grid is resolved in ver. 4.2.0.
Regards,
Boyko Markov
Smart Html Elements Team
https://www.htmlelements.com/admin
KeymasterI have a workaround – I actually already had the keys in my own object, which I used to initialize app.
// Note: data can only be nested one-deep!
// As well, event functions cannot be nested!
const smartData = {
enrollmentNewSubmit: newEnrollmentSubmit,
enrollmentNew: {
courseID: ”,
loginName: ”,
studentID: ”
},
schoolNewSubmit: newSchoolSubmit,
schoolNew: {
name: ”,
shortName: ”,
description: ”,
address: ”,
city: ”,
stateCode: ”,
zipCode: ”,
province: ”,
country: ‘US’,
postalCode: ”,
codes: ”,
tags: ”,
notes: ”,
annex: ”
}
};
So, I can e.g.
for (const key of Object.keys(smartData.schoolNew)) {
console.log(<backtick>key: ${key} hasOwnProperty: ${boundAttrs.hasOwnProperty(key)} type: ${typeof boundAttrs[key]}<backtick>);
}
So, I can iterate through that way and get only my own added properties.
Please add some easy way to do this in the future, or let me know what I am missing if it already exists.admin
KeymasterWell, ignoring functions won’t do it. Because the Proxy object has e.g. _canNotify which is boolean, propertyName string, notifyFn object.
I could filter these out explicitly (along with functions) after copying with Object.assign() but then I have to worry with each future release what has been added that I have to filter out.
What am I missing here? What is the use of of this if I cannot iterate my own properties that I added in app.data without pollution? I need to make a separate redundant list of my key names, it is a royal pain.admin
KeymasterUgh! This forum is IMPOSSIBLE! That code did not paste right. The forum did not like my backticks!
The line in my “for” is: (I substitute <backtick> for actual backtick below, because the forum doesn’t like backtick…)
console.log(<backtick>key: ${key} hasOwnProperty: ${boundAttrs.hasOwnProperty(key)}<backtick>);admin
KeymasterTo be more clear:
const boundAttrs = app.data.schoolNew;
console.info(‘boundAttrs’, boundAttrs);
console.info(‘boundAttrs.keys:’, Object.keys(boundAttrs));
for (const key of Object.keys(boundAttrs)) {
console.log(key: ${key} hasOwnProperty: ${boundAttrs.hasOwnProperty(key)});
}
This gives me the list of keys from above, and after adding check for own property, they are all own property.
So, how do I get JUST the bound variables from the Proxy object, WITHOUT pollution like “propertyName”, etc?
I guess I can filter out functions, and what is left will just be my properties? Isn’t there some function to do that for me? It would seem very common to want to iterate through bound variables, but there seems no convenient way to do it.
admin
KeymasterSorry. That did not paste as I expected! (And there doesn’t seem to be any way to edit a post?)
boundAttrs.keys: (23) [“name”, “shortName”, “description”, “address”, “city”, “stateCode”, “zipCode”, “province”, “country”, “postalCode”, “codes”, “tags”, “notes”, “annex”, “hasOwnProperty”, “isPrototypeOf”, “propertyIsEnumerable”, “toString”, “valueOf”, “toLocaleString”, “_canNotify”, “notifyFn”, “propertyName”] -
AuthorPosts