Jump to content

Client Widget Render


Blesta Addons

Recommended Posts

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 ?

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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));
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...