An autocompletion framework to complement the SproutCore datastore framework.
QAC.ScqlGuesser
: The root controller. Text goes in, a stack of query tokens and a list of next-up guesses comes out. Used byQAC.QueryFieldView
; you can also implement your own view by consuming thecurrentText
,tokenStack
andguesses
properties. When you need to snag the query's full text out, get thefullText
property.QAC.AttributeGuesser
: Suggests attribute autocompletions, including for related records. Used by the ScqlGuesser class when the user is entering an attribute.- QAC.QueryFieldView: A view which manages the text entry, token display and autocompletions generated by
QAC.ScqlGuesser
.
Includes an extension to SC.Record to facilitate class-level attribute introspection.
MyApp.QueryView = QAC.QueryFieldView.extend({ controller: QAC.ScqlGuesser.extend({ recordType: MyApp.MyRecordType }) });