control in datagrid form gone after issuing dtg refresh

Login or register to post comments
5 replies [Last post]
animekun's picture
Offline
Joined: 04/05/2008

i've recreate test using examples/datagrid/links_images.php
add button to this page, and issuing dtg refresh on action will remove all the control such as button or image control. Actually it is still rendered on the page but it has [CDATA things from ajax, i use qcube 1.1 snapshot about a weeks ago.

my modification to the links_images.php file is:
1. add declaration,
protected $btnTest;
2. add this into Form_Create

$this->btnTest = new QButton($this);
            $this->btnTest->Text = 'test';
            $this->btnTest->AddAction(new QClickEvent(), new QAjaxAction('btnTest_Click'));

3.add function handler
public function btnTest_Click(){
            $this->dtgPersons_Bind();
            $this->dtgPersons->Refresh();
        }

and add btnTest->Render() in links_images.tpl.php of course.

then i start the page, and hit the test button, then all image and button is gone, am i wrong or is that something there?

thanks.
ratno

Offline
Joined: 09/14/2009

Were you able to fix this problem? I am running into the same issue.

alex94040's picture
Offline
Joined: 11/06/2008

Button's parent should be the datagrid, not the QForm. Let me know if this makes sense.

Offline
Joined: 06/04/2010

Hello guys.
I have a similar problem : After Refresh() my Datagrid in QPanel, my images controls in Datagrid are surrounded by <!--[CDATA[ :

<!--[CDATA[
<img id=""...... />
]]>

I use Qcube 2.0.1. I have not found the solution of this problem in this forum.
Thank you.

Offline
Joined: 05/20/2010

I'm using QCubed 2.0.2 and whenever I create a panel through an AJAX request I'm seeing the closing tag for the CDATA (i.e. ]]>) left on the page. I haven't traced through to see what the source of this problem is, but all my other AJAX requests don't cause it. For now I have switched those calls to standard Server POST backs.

jcamyot's picture
Offline
Joined: 08/16/2011

Thank you Alex, I had the same problem and setting the parent to the datagrid fixed it!