null/demo.local.php
[gitlive] / FixBug.js
index c84d1eb..813382c 100644 (file)
--- a/FixBug.js
+++ b/FixBug.js
@@ -244,8 +244,16 @@ FixBug=new XObject({
                                                     var value = ''+ret.model.get_value(ret.iter, 0).value.get_string();
                                                     
                                                     print(value);
-                                                    
-                                                    
+                                                    var rec = false;
+                                                    this.get('/ticket-store').data.forEach( function(e) {
+                                                        if (e.id == value) {
+                                                            rec = e;
+                                                            return  false;
+                                                        }
+                                                    });
+                                                    // update the text box with the ticket data..
+                                                    this.get('/view').show(rec);
+                                                    //print(rec);
                                                 
                                                 }
                                             },
@@ -303,7 +311,10 @@ FixBug=new XObject({
                                                     },
                                                     loadData : function (data) {
                                                             print("loading data");
-                                                                                        
+                                                        
+                                                        
+                                                        this.data = data;
+                                                                              
                                                         var el = this.el;
                                                         this.el.clear();
                                                         data.forEach(function(p) {
@@ -419,11 +430,11 @@ FixBug=new XObject({
                                             items : [
                                                 {
                                                     xtype: Gtk.TextView,
-                                                    editable : false,
                                                     id : "view",
                                                     indent_width : 4,
                                                     pack : "add",
                                                     auto_indent : true,
+                                                    editable : false,
                                                     init : function() {
                                                         XObject.prototype.init.call(this);
                                                         var description = Pango.font_description_from_string("monospace");
@@ -446,6 +457,22 @@ FixBug=new XObject({
                                                          
                                                          
                                                         
+                                                    },
+                                                    show : function(p) {
+                                                         var line =  [
+                                                                'Status : ' +   p.status_name,
+                                                                'ID : ' +   p.id,
+                                                                '',
+                                                                'Summary :  ' +  p.summary,
+                                                                 '' + 
+                                                                 p.description,
+                                                             ].join("\n")   ;
+                                                             print(line);
+                                                             
+                                                             
+                                                             // can not do rich text due to so many missing features..
+                                                              this.el.get_buffer().set_text(line, line.length);
+                                                     
                                                     },
                                                     show_line_numbers : true,
                                                     items : [