~ideamonk/sahana-eden/gsoc

« back to all changes in this revision

Viewing changes to static/scripts/S3UI/core.js

  • Committer: ideamonk
  • Date: 2010-08-16 17:03:24 UTC
  • Revision ID: abhishekmishra@mbp.local-20100816170324-bm9f36i24qihohua
fixed creat_list views, added dirty hacks to handle it, createProxy changed to hook format param properly, need @value to solve value less references 

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        -------------------------------------------------------------------- */
37
37
        data_createProxy: function(url){
38
38
            // @url - url of the restful API
 
39
            if (url.indexOf("?")>0){
 
40
                url += "&format=json";
 
41
            } else {
 
42
                url += ".json";
 
43
            }
39
44
            this.proxy = new Ext.data.HttpProxy({
40
45
                url: url
41
46
            });
202
207
                        return false;
203
208
                    }
204
209
                }
 
210
                /*if (this.is_reference){
 
211
                    if (this._parent.store.reader.jsonData[this.reference_key]){
 
212
                        // exists in reference data
 
213
                        // no point, is an O(n) traversal on store.reader.jsonData.[ref_key] with uuid which 
 
214
                        // is not available.
 
215
                    }
 
216
                }*/
205
217
                if (this.is_combo){
206
 
                    this._parent.initComboData['combo_' + this.name+'_'+v["@value"]] = v["$"];
 
218
                    if (this.is_reference){
 
219
                        if (v["$"]){
 
220
                            this._parent.initComboData['combo_' + this.name+'_'+v["@value"]] = v["$"];
 
221
                        } else {
 
222
                            // v["$"] is not available in referenced data, must be picked from reference object
 
223
                            // but again uuid is not available at this point,
 
224
                        }
 
225
                    } else {
 
226
                        this._parent.initComboData['combo_' + this.name+'_'+v["@value"]] = v["$"];
 
227
                    }
207
228
                    return v["@value"];
208
229
                }
209
230
                return v["@value"];
247
268
                if (list[i].type.indexOf("reference ") == 0){
248
269
                    item.mapping = "$k_" + item.name;
249
270
                    item.is_reference = true;
 
271
                    item.reference_key = '$_' + list[i].type.split('reference ')[1];
250
272
                }
251
273
                item.convert=this.data_fieldConvert;
252
274
                this.list_fields.push(item);