Changeset 961 for MDService2/trunk/MDService2/WebContent
- Timestamp:
- 12/03/10 20:44:51 (14 years ago)
- Location:
- MDService2/trunk/MDService2/WebContent/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js
r945 r961 279 279 function appendQueryUI(json,i, qs){ 280 280 var del = ''; 281 var name = ''; 281 282 //var ul; 282 283 var id = $(qs).parent().attr('id'); … … 300 301 if (id == 'userqs') { 301 302 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>'; 302 307 } 303 308 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>' + 305 310 del + 306 311 '<div class="detail" >' + 312 name + 307 313 '<div class="cmds-elem-prop"><span class="label">squery:</span><span class="value">' + json.squerystring + 308 314 '</span></div>' + … … 313 319 $(qs).append(x); 314 320 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 }); 315 337 } 316 338 … … 1043 1065 jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"] = [{}]; 1044 1066 } 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; 1047 1072 saveWorkspace("USER"); 1048 1073 appendQueryUI(jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"][iq],iq, $('#userqueries')); -
MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js
r923 r961 69 69 } 70 70 return this.columns_widget.getColumnsListText(); 71 } 71 }; 72 72 73 73 Query.prototype.query_uri = function () {
Note: See TracChangeset
for help on using the changeset viewer.