Blesta Addons Posted November 6, 2014 Report Posted November 6, 2014 My question is just to know exactly the mecanism of rendering the widget in client home .if i take the services and invoices widget as example , thier function end with if ($this->isAjax()) return $this->renderAjaxWidgetIfAsync(isset($this->get['whole_widget']) ? null : (isset($this->get[1]) || isset($this->get['sort']))); in the view , there are $this->WidgetClient->create($this->_("ClientServices.index.boxtitle_services", true), array('id'=>"client_services"), $this->Html->ifSet($render_section, null)); the same logic i have in a plugin , but is not render the box , is render output like {"replacer":".panel_content","content":"\t\t\htmlxxxxxxxxxxxx","message":null} but the service and invoice and transaction , thier input like {"replacer":null,"content":"\n\t\t\n\t\t\t\thghghghghghghg","message":null} when i change my view file to $this->WidgetClient->create($this->_("ClientServices.index.boxtitle_services", true), array('id'=>"client_services"), null); it work perfectly , the question is , how we can controll $render_section from the controller . i have searched all the code , and i have not arrived to how ?!!! is the core widget is rendered via the jquery client file ? or i have missed something ? Quote
Tyson Posted November 6, 2014 Report Posted November 6, 2014 What is at the end of the controller that renders your page? It sounds like you're submitting an ajax request for the widget and not specifying 'whole_widget', or you're viewing paginated or sorted results, and each of those actions only returns widget content to display rather than the whole widget again. Quote
Blesta Addons Posted November 6, 2014 Author Report Posted November 6, 2014 What is at the end of the controller that renders your page? It sounds like you're submitting an ajax request for the widget and not specifying 'whole_widget', or you're viewing paginated or sorted results, and each of those actions only returns widget content to display rather than the whole widget again. is specified in my first post if ($this->isAjax()) return $this->renderAjaxWidgetIfAsync(isset($this->get['whole_widget']) ? null : (isset($this->get[1]) || isset($this->get['sort']))); i have copy/paste some core example .you can check my last plugin "support_manager_addons" you will find the right exemple , with this it render a good widget box . $this->WidgetClient->create($this->_("ClientServices.index.boxtitle_services", true), array('id'=>"client_services"), null); with this is rending content without a table box $this->WidgetClient->create($this->_("ClientServices.index.boxtitle_services", true), array('id'=>"client_services"), $this->Html->ifSet($render_section, null)); Quote
Tyson Posted November 7, 2014 Report Posted November 7, 2014 with this is rending content without a table box $this->WidgetClient->create($this->_("ClientServices.index.boxtitle_services", true), array('id'=>"client_services"), $this->Html->ifSet($render_section, null)); "...rendering content without a table box"? How do you mean? Perhaps you are missing a container div? Take a look at the Support Manager plugin, ./plugins/support_manager/views/default/client_tickets.pdt. Notice that $render_section is used to also set a container div. Is that missing from your template? Quote
Blesta Addons Posted November 7, 2014 Author Report Posted November 7, 2014 This Question is only related to ajax request . and the probleme is here $this->Html->ifSet($render_section, null)); when in controller i can set $render_section to null ? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.