[TYPO3-formidable] majixRepaint problem with row deleting in lister
Stéphane FILLION
s.fillion at ameos.com
Wed Sep 1 17:34:05 CEST 2010
Hello Domi,
I works :
<datasource:DB name="fe_users">
<sql><![CDATA[
SELECT fe_users.* FROM fe_users WHERE 1=1
]]></sql>
</datasource:DB>
<renderlet:LISTER name="mylist">
<datasource use="fe_users" />
<columns>
<column name="username" type="renderlet:TEXT" listHeader="User name" />
<column name="crdate" type="renderlet:DATE" listHeader="User CR date">
<data>
<datetime format="%d %B %Y" locale="fr_FR" />
</data>
</column>
<column type="CHECKSINGLE" name="deleted" listHeader="deleted" />
<column type="renderlet:BUTTON" label="delete" name="btnDelete" sort="false">
<onclick runat="ajax" params="rowData::uid" cache="false">
<userobj>
<php><![CDATA[
$aParams = $this->oMajixEvent->getParams();
$where = 'uid='.$aParams["uid"];
$GLOBALS["TYPO3_DB"]->exec_UPDATEquery('fe_users',$where, array('deleted'=>1));
return $this->aORenderlets["mylist "]->majixRepaint();
]]></php>
</userobj>
</onclick>
</column>
</columns>
</renderlet:LISTER>
I don't understand why your snippet don't work.
Can you give me your datasource too ?
Otherwise,
In your codeBehind, the parameters is passed in the arguments on your function :
function delete_favorit_click($aParams) {
$where = 'uid='.$aParams["uid"];
$GLOBALS["TYPO3_DB"]->exec_DELETEquery('tx_dmfaupairs_favorites',$where);
return $this->oForm->aORenderlets["favoritlister"]->majixRepaint();
}
Regards,
Stéphane
-----Message d'origine-----
De : typo3-project-formidable-bounces at lists.typo3.org [mailto:typo3-project-formidable-bounces at lists.typo3.org] De la part de Domi Garms
Envoyé : lundi 23 août 2010 08:17
À : TYPO3 project list for the FORMidable extension
Objet : [TYPO3-formidable] majixRepaint problem with row deleting in lister
Hello Formidables,
I try to delete a row in a lister with codebehind and an onclick ajax
event. The row gets deleted in the DB-table, but majixRepaint is not
working.
My Lister:
<renderlet:LISTER name="favoritlister">
<datasource use="favorites" />
<ifEmpty message="You dont have any favorites yet!" />
<columns>
<column name="uid" type="renderlet:TEXT" />
<column name="tstamp" type="renderlet:DATE" >
<data>
<dateTime format="%d.%m.%Y" />
</data>
</column>
<column name="user" type="renderlet:TEXT" />
<column name="last_name" type="renderlet:LINK" />
<column name="first_name" type="renderlet:TEXT" />
<column name="favorite" type="renderlet:TEXT" />
<column type="renderlet:BUTTON" label="delete" name="btnDelete"
sort="false">
<onclick
runat="ajax"
params="rowData::uid"
cache="false"
exec="coding.delete_favorit_click()"
/>
</column>
</columns>
</renderlet:LISTER>
And codebehind.php
class codebehind {
function delete_favorit_click() {
// requesting parameters from the event
$aParams = $this->oForm->oMajixEvent->getParams();
$where = 'uid='.$aParams["uid"];
$GLOBALS["TYPO3_DB"]->exec_DELETEquery('tx_dmfaupairs_favorites',$where);
return $this->oForm->aORenderlets["favoritlister"]->majixRepaint();
}
}
Does somebody sees my errorcode? I did this on the snippet of
http://formidable.typo3.ug/tutorials/editing-in-list-with-modalbox.html
Thanks for any help
Greetings Dominic
_______________________________________________
TYPO3-project-formidable mailing list
TYPO3-project-formidable at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-formidable
More information about the TYPO3-project-formidable
mailing list