powmedia / backbone-forms

Form framework for BackboneJS with nested forms, editable lists and validation
MIT License
2.17k stars 413 forks source link

Sorting Lists #314

Open exussum12 opened 11 years ago

exussum12 commented 11 years ago

Refs

312

Called like this

  var schema = {
    //List
    textList: { type: 'List', itemType: 'Text', validators: ['required'], sort:true },
  };

true sorts based on getValue() a function is used instead when passed that way, function requires 2 arguments and should follow this https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort

exussum12 commented 10 years ago

The pull request so far works, Im struggling to trigger the blur event to sort the array though.

powmedia commented 9 years ago

You mentioned you were having trouble triggering the blur event; is that fixed?

I'm unable to test at the moment so if anyone can verify this PR please let me know it's good to merge.

exussum12 commented 9 years ago

Not sure to be honest, I accidently deleted branches a while back and it closed all pull requests, just adding them back. I cant remember if it was triggering the blur tests ? Ill have a try later on