Skip to content

Validate Model #13157

Answered by m1ga
beppo-ivel asked this question in Q&A
Oct 31, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Did you check the Extending the Backbone.Model class example at https://titaniumsdk.com/guide/Alloy_Framework/Alloy_Guide/Alloy_Models/Alloy_Collection_and_Model_Objects.html#extending-the-backbone-model-class ? That works fine and you can use isValid() to check the validation. I don't know the syntax Alloy.Models.test.set({attr1: "test", attr2: 0}) I use

var m = Alloy.createModel("test", {
  attr1:"text1",
  attr2:""
})

and then m.save() or m.isValid()

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@beppo-ivel
Comment options

@m1ga
Comment options

m1ga Nov 1, 2021
Collaborator

@m1ga
Comment options

m1ga Nov 1, 2021
Collaborator

Answer selected by beppo-ivel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants