def get_save_wdg(my): # add the popup popup = PopupWdg(id="save_search_wdg") popup.add("Save Search", "title") div = DivWdg() div.add("Save current search as: ") text = TextWdg("save_search_text") text.set_id("save_search_text") div.add(text) save_button = ButtonWdg("Save Search") behavior = {"type": "click", "mouse_btn": "LMB", "cbjs_action": "spt.dg_table.save_search_cbk(evt, bvr);"} save_button.add_behavior(behavior) cancel_button = ButtonWdg("Cancel") cancel_button.add_event("onclick", "$('save_search_wdg').style.display = 'none'") div.add(HtmlElement.hr()) button_div = DivWdg() button_div.add_style("text-align: center") button_div.add(save_button) button_div.add(" ") button_div.add(cancel_button) div.add(button_div) popup.add(div, "content") return popup
def get_save_wdg(self): div = DivWdg() div.add("Save current search as: ") text = TextWdg("save_search_text") text.set_id("save_search_text") div.add(text) save_button = ButtonWdg("Save Search") behavior = { 'cbjs_action': 'spt.table.save_search();' } save_button.add_behavior( behavior ) cancel_button = ButtonWdg("Cancel") cancel_button.add_event("onclick", "$('save_search_wdg').style.display = 'none'") div.add(HtmlElement.hr()) button_div = DivWdg() button_div.add_style("text-align: center") button_div.add(save_button) button_div.add(" ") button_div.add(cancel_button) div.add(button_div) return div
def get_js_popup(my): # Add in javascript logger console pop-up ... # This is particularly useful for being able to print out debug info in javascript when testing # and debugging in IE or in FF without Firebug (where console.log is not defined) # js_popup_id = "WebClientOutputLogPopupWdg" js_popup = PopupWdg(id=js_popup_id, allow_page_activity=True, width="630px") js_popup.add("TACTIC™ Web Client Output Log", "title") js_content_div = DivWdg() button = ButtonWdg("Clear") button.add_style("margin: 5 10") button.add_event("onclick", "$('spt_js_log_output_div').innerHTML = ''") js_content_div.add(button) js_content_div.add( HtmlElement.hr() ) js_div = DivWdg(id="spt_js_log_output_div") js_div.add_style("background: #000000") js_div.add_style("font-family: Courier, Fixed, serif") js_div.add_style("font-size: 11px") js_div.add_style("padding: 3px") js_div.add_style("color: #929292") js_div.add_style("width: 600px") js_div.add_style("height: 400px") js_div.add_style("overflow: auto") # Get user preference for the Web Client Output Console logging level ... log_level = PrefSetting.get_value_by_key("js_logging_level") if not log_level: log_level = "WARNING" # set js logging level to 'WARNING' as a default! PrefSetting.create("js_logging_level",log_level) js_div.set_attr("spt_log_level", log_level) js_content_div.add( js_div ) js_popup.add( js_content_div, 'content' ) return js_popup
def get_save_wdg(my): # add the popup popup = PopupWdg(id='save_search_wdg') popup.add("Save Search", "title") div = DivWdg() div.add("Save current search as: ") text = TextWdg("save_search_text") text.set_id("save_search_text") div.add(text) save_button = ButtonWdg("Save Search") behavior = { 'type': 'click', 'mouse_btn': 'LMB', 'cbjs_action': 'spt.dg_table.save_search_cbk(evt, bvr);' } save_button.add_behavior(behavior) cancel_button = ButtonWdg("Cancel") cancel_button.add_event("onclick", "$('save_search_wdg').style.display = 'none'") div.add(HtmlElement.hr()) button_div = DivWdg() button_div.add_style("text-align: center") button_div.add(save_button) button_div.add(" ") button_div.add(cancel_button) div.add(button_div) popup.add(div, "content") return popup
#select.set_option("query", "config/widget_config|view|view") select.set_option("values", views) #select.set_option("query_filter", "\"view\" like 'saved_search:%'") div.add(select) retrieve_button = ButtonWdg("Retrieve Search") behavior = { 'type': 'click', 'cbjs_action': 'spt.dg_table.retrieve_search_cbk(evt, bvr);' } retrieve_button.add_behavior( behavior ) cancel_button = ButtonWdg("Cancel") cancel_button.add_event("onclick", "$('retrieve_search_wdg').style.display = 'none'") div.add(HtmlElement.hr()) button_div = DivWdg() button_div.add_style("text-align: center") button_div.add(retrieve_button) button_div.add(" ") button_div.add(cancel_button) div.add(button_div) popup.add(div, "content") return popup def get_save_wdg(my):
select.set_id("saved_search") select.add_empty_option("-- Select --") #select.set_option("query", "config/widget_config|view|view") select.set_option("values", views) #select.set_option("query_filter", "\"view\" like 'saved_search:%'") div.add(select) retrieve_button = ButtonWdg("Retrieve Search") behavior = { 'type': 'click', 'cbjs_action': 'spt.dg_table.retrieve_search_cbk(evt, bvr);' } retrieve_button.add_behavior(behavior) cancel_button = ButtonWdg("Cancel") cancel_button.add_event( "onclick", "$('retrieve_search_wdg').style.display = 'none'") div.add(HtmlElement.hr()) button_div = DivWdg() button_div.add_style("text-align: center") button_div.add(retrieve_button) button_div.add(" ") button_div.add(cancel_button) div.add(button_div) popup.add(div, "content") return popup def get_save_wdg(my):