PDA

View Full Version : Paging Refresh breaks the RowEditor!!!!!!!!!!!!!!!!!!



RAD001
6 Jun 2011, 12:18 PM
Hi,

I have paging on RowEditing Grid and it works fine on the first load( first page) as soon as I hit refresh or go to the next page the RowEditor breaks with :

Message: Unspecified error.
Line: 11763
Char: 21
Code: 0
URI: http://localhost/ext-all-debug.js (http://localhost/manage/extjs4/ext-all-debug.js)


I recreated the issue with paging example and I added the RowEditor.

Please advice what's wrong as this is the important part of the project.

Thanks,




Ext

.Loader.setConfig({enabled:true});



Ext.Loader.setPath('Ext.ux','../ux/');

Ext





.require([


'Ext.grid.*',

'Ext.data.*',

'Ext.util.*',
'Ext.toolbar.Paging',
'Ext.ux.PreviewPlugin',
'Ext.ModelManager',
'Ext.tip.QuickTipManager'
]);







?

?

Ext.onReady(function(){
Ext






.tip.QuickTipManager.init();



Ext.define('ForumThread',{

extend





:'Ext.data.Model',


fields



:[


'title','forumtitle','forumid','author',

{name:'replycount', type:'int'},

{name:'lastpost', mapping:'lastpost', type:'date', dateFormat:'timestamp'},
'lastposter','excerpt','threadid'
],
idProperty






:'threadid'


});




// create the Data Store

var store = Ext.create('Ext.data.Store',{

pageSize






:50,


model



:'ForumThread',


remoteSort



:true,


proxy



:{


// load using script tags for cross domain, if the data in on the same domain as

// this page, an HttpProxy would be better

type






:'jsonp',


url



:'http://www.sencha.com/forum/topics-browse-remote.php',


reader



:{


root



:'topics',


totalProperty



:'totalCount'


},

// sends single sort as multi parameter

simpleSortMode






:true


},

sorters





:[{


property



:'lastpost',


direction



:'DESC'


}]

});






// pluggable renders

function renderTopic(value, p, record){

return Ext.String.format(
'<b><a href="http://sencha.com/forum/showthread.php?t={2}" target="_blank">{0}</a></b><a href="http://sencha.com/forum/forumdisplay.php?f={3}" target="_blank">{1} Forum</a>',
value






,


record



.data.forumtitle,


record



.getId(),


record



.data.forumid


);

}






function renderLast(value, p, r){

return Ext.String.format('{0}<br/>by {1}', Ext.Date.dateFormat(value,'M j, Y, g:i a'), r.data['lastposter']);

}







var rowEditing = Ext.create('Ext.grid.plugin.RowEditing',{

clicksToMoveEditor





:1,


autoCancel



:false


});

var pluginExpanded =false;

var grid = Ext.create('Ext.grid.Panel',{
width






:700,


height



:500,


title



:'ExtJS.com - Browse Forums',


store



: store,


plugins



:[rowEditing],


// disableSelection: true,

loadMask





:true,



// grid columns

columns





:[{


text



:"Title",


dataIndex



:'title',


width



:300,


sortable



:true,


field



:{


xtype



:'textfield'



}

},{

text






:"author",


dataIndex



:'author',


width



:300,


sortable



:true,


field



:{


xtype



:'textfield'



}

}],

// paging bar on the bottom
bbar






: Ext.create('Ext.PagingToolbar',{


store



: store,


displayInfo



:true,


displayMsg



:'Displaying topics {0} - {1} of {2}',


emptyMsg



:"No topics to display"


}),

renderTo





:'topic-grid'


});




// trigger the data store load

store





.loadPage(1);


});









<!DOCTYPE





HTMLPUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


<



html>


<



head>


<



metahttp-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<



title>Paging Grid Example</title>



<linkrel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />

<linkrel="stylesheet" type="text/css" href="../shared/example.css" />






<scripttype="text/javascript" src="../../bootstrap.js"></script>

<scripttype="text/javascript" src="paging.js"></script>

<style>
.x-grid-cell-topicb {
display:block;
}
.x-grid-cell-topic.x-grid-cell-inner {
white-space:normal;
}
.x-grid-cell-topica {
color:#385F95;
text-decoration:none;
}
.x-grid-cell-topica:hover {
text-decoration:underline;
}
.x-grid-cell-topic.x-grid-cell-innerf {
padding:5px;
}
.x-grid-rowbody {
padding:05px5px5px;
}
</style>
</






head>


<



body>


<h1>Paging Grid Example</h1>

<p>This example shows how to create a grid with paging. This grid uses a Ext.data.proxy.JsonP proxy

to fetch cross-domain remote data (from the Ext forums).</p>
<p>Note that the js is not minified so it is readable. See <ahref="paging.js">paging.js</a>.</p>
<divid="topic-grid"></div>
</






body>


</




html>