[#113,docs/tutorial][l]: tutorial-basics written giving introduction to dataset and associated functionality.
* Minor corrections to several other parts of docs.
This commit is contained in:
13
_includes/tutorial-basics-ex-2.js
Normal file
13
_includes/tutorial-basics-ex-2.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// must have a div with class="ex-1"
|
||||
var $el = $('.ex-2');
|
||||
|
||||
// query with text 'UK' - this will attempt to match any field for UK
|
||||
// Also limit the query to return a maximum of 2 results using the size attribute
|
||||
|
||||
// query function has asynchronous behaviour and returns a promise object
|
||||
// (even for the case of in memory data where querying in fact happens synchronously)
|
||||
// On completion the display function will be called
|
||||
dataset.query({q: 'UK', size: 2}).done(function() {
|
||||
display(dataset);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user