Ignore:
Timestamp:
12/03/10 20:44:51 (14 years ago)
Author:
gaba
Message:

query-names

Location:
MDService2/trunk/MDService2/WebContent/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js

    r945 r961  
    279279function appendQueryUI(json,i, qs){
    280280        var del = '';
     281        var name = '';
    281282        //var ul;
    282283        var id = $(qs).parent().attr('id');
     
    300301        if (id == 'userqs') {
    301302                del = '<span class="cmd cmd_del" ><xsl:text> </xsl:text></span>';
     303                name = '<div class="cmds-elem-prop"><span class="label">name:</span><input type="text" class="input-name" value="' + json.name + '"></div>';
     304        } else {
     305                name = '<div class="cmds-elem-prop"><span class="label">name:</span><span class="value">' + json.name +
     306                '</span></div>';
    302307        }
    303308        var x = '<div class="cmds-elem-plus" ><span class="cmd cmd_load"></span><span class="detail-caller" ><a href="'+id + '_'+ i+'" >' +
    304         Query.fullformatstring(json) + '</a></span>' +
     309        json.name + '</a></span>' +
    305310        del +
    306311        '<div class="detail" >' +
     312        name +
    307313        '<div class="cmds-elem-prop"><span class="label">squery:</span><span class="value">' + json.squerystring +
    308314        '</span></div>' +
     
    313319        $(qs).append(x);
    314320       
     321       
     322        $(qs).find('.input-name').keydown(function(ev){
     323                var evStop = function(){
     324                        ev.stopPropagation();
     325                        ev.preventDefault();
     326                };
     327                if (ev.which === 13) {
     328                        var id = parseInt( $("#serverqts_select option:selected").val());
     329                        $(this).parent().parent().parent().find('a').text($(this).val());
     330                        var str = $(this).parent().parent().parent().find('a').attr("href");
     331                        var iq = parseInt(str.substring(7));
     332                        jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"][iq].name = $(this).val();
     333                        saveWorkspace("USER");
     334                        evStop();
     335                }
     336        });
    315337}
    316338
     
    10431065                        jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"] = [{}];
    10441066                }
    1045                
    1046                 jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"][iq] = {"squerystring":squery, "querystring":qstring,"searchclauses":"null" , "collections" : json_coll, "columns" : json_cols};
     1067                var jsonq = {"name":"", "squerystring":squery, "querystring":qstring,"searchclauses":"null" , "collections" : json_coll, "columns" : json_cols};
     1068                var name = Query.fullformatstring(jsonq);
     1069                jsonq.name = name;
     1070               
     1071                jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"][iq] = jsonq;
    10471072                saveWorkspace("USER");
    10481073                appendQueryUI(jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"][iq],iq, $('#userqueries'));
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js

    r923 r961  
    6969        }
    7070        return this.columns_widget.getColumnsListText();
    71 }
     71};
    7272
    7373Query.prototype.query_uri = function () {
Note: See TracChangeset for help on using the changeset viewer.