function TrackPrio__renderCell(Dataface_Record $record){ Dataface_JavascriptTool::getInstance()->import('editable_status.js'); $query = Dataface_Application::getInstance()->getQuery(); $table =& Dataface_Table::loadTable($query['-table']); $options = $table->getValuelist('Prio'); $currVal = $record->display('TrackPrio'); $out = array(); $out[] = '<select class="status-drop-down" data-record-id="'.htmlspecialchars($record->getId()).'">'; foreach ( $options as $opt ){ $selected = ($currVal === $opt) ? 'selected':''; $out[] = '<option value="'.htmlspecialchars($opt).'" '.$selected.'>' .htmlspecialchars($opt).'</option>'; } $out[] = '</select>'; return implode("\n", $out); }[Prio]0="None"1="Very Low"2="Low"3="Medium"4="High"5="Critical"(function(){ var $ = jQuery;
registerXatafaceDecorator(function(node){
$('select.status-drop-down[data-record-id]', node).change(function(){ var recordId = $(this).attr('data-record-id'); xataface.IO.update(recordId, {status : $(this).val()}, function(res){ if ( res && res.code == 200 ){ alert('Issue updated successfully'); } else if ( res && res.message ){ alert('Failed to update issue: '+res.message); } else { alert('Failed to update issue. Check server log for details'); } }) }); });
})();To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/3c5a97b1-7b2f-44c2-82e9-99914796a853%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at https://groups.google.com/group/xataface.
XHR finished loading: POST "https://[domain].com/index.php".
send @ jquery.packed.js:6
m.extend.ajax @ jquery.packed.js:6
m.(anonymous function) @ jquery.packed.js:6
update @ index.php?-action=js&--id=global.js-fbf9a3ac6727b0b25b53f4a9cfb828a4:82
(anonymous function) @ index.php?-action=js&--id=global.js-fbf9a3ac6727b0b25b53f4a9cfb828a4:87
m.event.dispatch @ jquery.packed.js:5
r.handle @ jquery.packed.js:5
var fieldName = $(this).attr('fieldName');How are you embedding the javascript? Are you sure it's being picked up at all.