allow string based values for comboboxarray
[roojs1] / Roo / doc / Synopsis.js
1 /*
2  * - LGPL
3  *
4  */
5
6 /**
7  * @class Roo.doc.Synopsis
8  * @extends Roo.bootstrap.Component
9  * Synopsis Element class
10  * @cfg {String} returntype return value
11  * @cfg {String} returndesc description of return value. (used in the return section if set..)
12  * @cfg {String} name title really..
13  * @cfg {String} stype (function|constant)
14  * @cfg {String} memberof class name
15  * @cfg {bool} is_static is a static member
16  * @cfg {bool} is_constructor is a static member
17  * 
18  * @constructor
19  * Create a new Synopsis
20  * @param {Object} config The config object
21  */
22
23 Roo.doc.Synopsis = function(config){
24     Roo.doc.Synopsis.superclass.constructor.call(this, config);
25 };
26
27 Roo.extend(Roo.doc.Synopsis, Roo.bootstrap.Component,  {
28     
29     memberof : '',
30     is_static : false,
31     returntype : '',
32     returndesc : '',
33     name: '',
34     stype:   'function',
35     is_constructor : false,
36     
37     getAutoCreate : function(){
38         
39         var syn = this.items[0]; // hopefully...
40         
41         
42         
43         var nmp = (this.is_static ? '' : '$') +
44             this.memberof +
45             (this.is_static ? '::' : '->');
46             
47         var nm = this.name;
48         // this should probably do the params....?? then we need to disable the rendering..
49         
50         if (this.is_constructor) {
51             
52             nm = this.memberof;
53             nmp = 'new ';
54         }
55         
56          
57         var cfg ={
58             tag: 'h5',
59             cls : 'refsynopsisdiv',
60             cn : [
61                 {
62                     cls: 'funcsynopsis',
63                     cn: [
64                         {
65                             tag: 'p',
66                             cn: {
67                                 tag:'code',
68                                 cls : 'funcprototype',
69                                 cn: [
70                                     this.returntype + ' ' + nmp,
71                                     {
72                                         tag: 'strong',
73                                         cls : this.stype,
74                                         html : nm
75                                     },
76                                     '(',
77                                     {
78                                         tag: 'span',
79                                         cls : 'roo-params'
80                                     },
81                                     ')'
82                                 ]
83                                 
84                             }
85                         }
86                     ]
87                 }
88                 
89             ]
90         };
91         
92         
93         
94         return cfg;
95     },
96     getChildContainer : function(build_call)
97     {
98          
99         
100         return this.el.select('.roo-params',true).first();
101     }
102     
103     
104     
105     
106    
107 });
108
109  
110
111