~shikharkohli/sahana-eden/gsoc1

« back to all changes in this revision

Viewing changes to static/scripts/S3importer/re_import.js

  • Committer: Shikhar Kohli
  • Date: 2010-08-11 17:36:22 UTC
  • Revision ID: shikharkohli@gmail.com-20100811173622-cjc6zkifvrocgp3y
changes for the new version of web2py, reimporting similar rows fixed and debugged, import of invalid rows debugged

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        Ext.Msg.alert("","These records could not be imported. Please edit and import again.");
27
27
        var column_model = new Array();
28
28
        fields = [];
 
29
        var tempmap = map;
29
30
        for(i = 0 ;i < map.length; i++)
30
31
        {
31
 
            var tempstr = map[i][2].indexOf("--");
 
32
            var tempstr = tempmap[i][2].indexOf("--");
32
33
                if(tempstr!=-1)
33
34
                {
34
 
                        var check = map[i][2].split(' --&gt; ');
35
 
                        fields.push( "$k_" + check[0] + ' --&gt; $_' + check[1] + ' --&gt; ' + check[2]);
 
35
                        var check = tempmap[i][2].split(' --> ');
 
36
                        fields.push( "$k_" + check[0] + ' --> $_' + check[1] + ' --> ' + check[2]);
36
37
                }
37
38
                
38
39
                else
39
 
                        fields.push(map[i][2]);
 
40
                        fields.push(tempmap[i][2]);
40
41
        }
41
42
        var store = new Ext.data.JsonStore({
42
43
                fields : fields,
140
141
                                                send.spreadsheet.push(temp);
141
142
                                                send.rows += 1;
142
143
                                        });
143
 
                                        for( i=0 ;i< map.length; i++)
144
 
                                        {
145
 
                                                map[i][2] = fields[i];
146
 
                                        }
 
144
                                        
147
145
                                        send.re_import = 'True';        
148
146
                                        send.map = map;
149
147
                                        console.log(send.map);