setTransactionMode() being ignored?

Hi all,

Back again with another noob type problem :slight_smile: .

I’ve been trying to update a grid via data from a form and I kept getting the following error:



<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Undefined index: !nativeeditor_status in C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php on line <i>122</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0011</td><td bgcolor='#eeeeec' align='right'>404976</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php' bgcolor='#eeeeec'>..\transportPreferences_gridUpdate.php<b>:</b>0</td></tr>
</table></font>


<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Undefined index: gr_id in C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php on line <i>123</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0011</td><td bgcolor='#eeeeec' align='right'>404976</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php' bgcolor='#eeeeec'>..\transportPreferences_gridUpdate.php<b>:</b>0</td></tr>
</table></font>


<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Undefined index: gr_id in C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php on line <i>124</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0011</td><td bgcolor='#eeeeec' align='right'>404976</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php' bgcolor='#eeeeec'>..\transportPreferences_gridUpdate.php<b>:</b>0</td></tr>
</table></font>


<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Undefined index: Transport_Type_ID in C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php on line <i>46</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0011</td><td bgcolor='#eeeeec' align='right'>404976</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php' bgcolor='#eeeeec'>..\transportPreferences_gridUpdate.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0134</td><td bgcolor='#eeeeec' align='right'>826584</td><td bgcolor='#eeeeec'>update_row(  )</td><td title='C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php' bgcolor='#eeeeec'>..\transportPreferences_gridUpdate.php<b>:</b>137</td></tr>
</table></font>


<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Undefined index: Preference_Level in C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php on line <i>46</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0011</td><td bgcolor='#eeeeec' align='right'>404976</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php' bgcolor='#eeeeec'>..\transportPreferences_gridUpdate.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0134</td><td bgcolor='#eeeeec' align='right'>826584</td><td bgcolor='#eeeeec'>update_row(  )</td><td title='C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridUpdate.php' bgcolor='#eeeeec'>..\transportPreferences_gridUpdate.php<b>:</b>137</td></tr>
</table></font>

So i did some looking around and a print_r($_POST) in the data processor php file showed this


[1_gr_id] => 1
[1_Transport_Type_ID] => 1
[1_Transport_Name] => Car
[1_Preference_Level] => 0
[1_Options] =>
[1_!nativeeditor_status] => inserted
[ids] => 1

Which would be fine a part from the fact that part of my configuration for the dataprocessor reads like this:

 transportDataProcessor.setTransactionMode("Get",true);

and a print_r for get returns only:


[editing] => true

Seems like the command is being ignored.

Any one got any ideas please ?

If you are using connector.js on the page - dataprocessor will automatically switch to POST ( as server side code of connector works with POST requests only )

To still apply get, use the same command, but be sure to place it after dataprocessor init

transportDataProcessor.init(someGrid); transportDataProcessor.setTransactionMode("Get",true);

Ah thanks Stanislav :slight_smile: ,

I recoded all my dataProcessors to use post any how so I’v managed to solve the problem, using post is probably the better option anyway.

This should be corrected in the example code; 02_all_at_once.html

Thanks for remark, sample is updated in local codebase and will be updated in next official build.