Jump to content

Recommended Posts

Posted

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 ?

 

 

 

Posted

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.

Posted
  On 11/6/2014 at 6:00 PM, Tyson said:

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));
Posted
  On 11/6/2014 at 11:08 PM, naja7host said:

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?

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...