4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-data-SequentialIdGenerator'>/**
19 </span> * @author Don Griffin
21 * This class is a sequential id generator. A simple use of this class would be like so:
23 * Ext.define('MyApp.data.MyModel', {
24 * extend: 'Ext.data.Model',
27 * // assign id's of 1, 2, 3, etc.
29 * An example of a configured generator would be:
31 * Ext.define('MyApp.data.MyModel', {
32 * extend: 'Ext.data.Model',
39 * // assign id's of ID_1000, ID_1001, ID_1002, etc.
42 Ext.define('Ext.data.SequentialIdGenerator', {
43 extend: 'Ext.data.IdGenerator',
44 alias: 'idgen.sequential',
46 constructor: function() {
49 me.callParent(arguments);
51 me.parts = [ me.prefix, ''];
54 <span id='Ext-data-SequentialIdGenerator-cfg-prefix'> /**
55 </span> * @cfg {String} prefix
56 * The string to place in front of the sequential number for each generated id. The
61 <span id='Ext-data-SequentialIdGenerator-cfg-seed'> /**
62 </span> * @cfg {Number} seed
63 * The number at which to start generating sequential id's. The default is 1.
67 <span id='Ext-data-SequentialIdGenerator-method-generate'> /**
68 </span> * Generates and returns the next id.
69 * @return {String} The next id.
71 generate: function () {
76 return parts.join('');