load failed -- arguments: [Object api=Object, Object request=Object reader=Object scope=Object, Object tId=0 status=200 statusText=OK, SyntaxError: missing } after property list message=missing } after property list]
I got that error by adding an exception to my store but don't see any real error in my code...maybe another set of eyes will help.
php:
case 'messages':
if(isset($_SESSION['id'])){
$stmt = $dbh->prepare("Select ID, ReceivedAt, Message from SystemEvents Limit 100");
$stmt->execute();
while($tmp = $stmt->fetch()){
$y .= '{"ID":"'.$tmp['ID'].'","ReceivedAt":"'.$tmp['ReceivedAt'].'","Message":"'.$tmp['Message'].'"},';
}
$y = trim($y,',');
if(isset($_REQUEST['callback'])){
echo $_REQUEST['callback'].'({"dates":['.$y.']});';
}else{
echo '{"dates":['.$y.']}';
}
}else{
if(isset($_REQUEST['callback'])){
echo $_REQUEST['callback'].'({success: false, data{"error_title": "Error", "errormsg": "Cannot display dates"}})';
}
else{
echo '{success: false, data{"error_title": "Error", "errormsg": "Cannot display dates"}}';
}
}
break;
extjs:
Ext.onReady(function(){
var logStore = new Ext.data.JsonStore({
autoLoad: true,
url: 'inc/interface/config.php?list=messages',
root: 'dates',
idProperty: 'ID',
fields: ['ID', 'ReceivedAt', 'Message'],
listeners: {
loadexception: function() {
console.log('load failed -- arguments: %o', arguments);
}
}
});
var dateStore = new Ext.data.JsonStore({
autoLoad: true,
url: 'inc/interface/config.php?list=date_options',
root: 'dates',
idProperty: 'ID',
fields: ['ID', 'ReceivedAt'],
listeners: {
loadexception: function() {
console.log('load failed -- arguments: %o', arguments);
}
}
});
var dateSelect = new Ext.form.DateField({
fieldLabel: 'Pick a date',
width: 190,
align: 'center',
frame: true
});
var dateCombo = new Ext.form.ComboBox({
store: dateStore,
mode: 'local',
valueField: 'ID',
displayField: 'ReceivedAt',
editable: false,
emptyText: 'Select a Date',
width: 250,
listeners:{
activate: function(){
dateStore.reload();
}
}
});
var searchField = new Ext.form.TextField({
fieldLabel: 'Search Criteria',
emptyText: 'Search....',
width: 190,
frame: true
});
var searchButton = new Ext.Button({
text: 'Search',
});
var clearButton = new Ext.Button({
text: 'Clear',
tooltip: 'Clears all your search data'
});
var searchPanel = new Ext.Panel({
layout: 'form',
region: 'east',
width: 300,
collapsible: true,
alignButton: 'right',
title: "Search Panel",
items: [dateSelect, dateCombo, searchField],
buttons: [clearButton, searchButton]
});
var logGrid = new Ext.grid.GridPanel({
region: 'center',
store: logStore,
colModel: new Ext.grid.ColumnModel({
columns: [{
id: 'received',
header: 'Received',
dataIndex: 'ReceivedAt',
width: 250
},{
id: 'message',
header: 'Logs',
dataIndex: 'Message',
width: 750
}]
}),
});
var mainViewport = new Ext.Viewport({
layout: 'border',
items: [logGrid, searchPanel]
});
});
I don't think posting the rest of my php would be relevant since it all works but hopefully someone can spot something that my bad eyes cannot.