def get_display(self): outer_div = DivWdg() outer_div.add_class('new-order-title-entry-form') self.get_order_code_select_widget(outer_div) self.get_order_entry_widget(outer_div) self.get_title_select_widget(outer_div) self.get_title_entry_wdg(outer_div) self.get_platform_select_widget(outer_div) self.get_languages_widget(outer_div) self.get_territory_widget(outer_div) self.get_description_input_widget(outer_div) self.get_total_program_runtime_widget(outer_div) self.get_checkboxes_section(outer_div) submit_button = SubmitWdg('Submit') submit_button.add_behavior(self.submit_button_behavior()) popup_button = ButtonWdg('Popup') popup_button.add_behavior({'css_class': 'popup_click', 'type': 'click_up', 'cbjs_action': 'spt.panel.load_popup("Test", "order_builder.OrderTitleEntryWdg", {});'}) outer_div.add(popup_button) outer_div.add(submit_button) return outer_div
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_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
views = SObject.get_values(configs, "view") select = SelectWdg("saved_search") 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")
views = SObject.get_values(configs, "view") select = SelectWdg("saved_search") 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")