enableDragDrop: true // enable drag and drop of grid rows
,ddGroup : 'mygrid-dd'
,viewConfig: {
emptyText: 'No items found',
sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
forceFit: true,
autoFill: true
}listeners: {
"render": {
scope: this,
fn: function(grid) {
// Enable sorting Rows via Drag & Drop
// this drop target listens for a row drop
// and handles rearranging the rows
var ddrow = new Ext.dd.DropTarget(grid.container, {
ddGroup : 'mygrid-dd',
copy:false,
notifyDrop : function(dd, e, data){
alert('Hello world!');
// NOTE:
// you may need to make an ajax call here
// to send the new order
// and then reload the store
// alternatively, you can handle the changes
// in the order of the row as demonstrated below
// ***************************************
var sm = grid.getSelectionModel();
var rows = sm.getSelections();
if(dd.getDragData(e)) {
var cindex=dd.getDragData(e).rowIndex;
if(typeof(cindex) != "undefined") {
for(i = 0; i < rows.length; i++) {
ds.remove(ds.getById(rows[i].id));
}
ds.insert(cindex,data.selections);
sm.clearSelections();
}
}
grid.collectItems();
// ************************************
}
})
this.setWidth('99%');
//this.syncSize();
// load the grid store
// after the grid has been rendered
//store.load();
}
}
}

&where=`{"name:=":"John Doe"}`
[[!$contactinfo? &contact=`John Doe`]]
contactinfo Chunk
--------------------------
<ul class="reset">
[[!getImageList?
&docid=`120`
&tvname=`contactinfo migx`
&tpl=`contactinfo.migx.tpl`
&contact=`[[+contact]]`
]]
</ul>
contactinfo.migx.tpl Tpl Chunk
--------------------------------------------
[[+name:is=`[[+contact]]`:then=`
<li>
<dl class="reset">
<dt>No</dt><dd>[[+idx]]</dd>
<dt>Name</dt><dd>[[+name]]</dd>
<dt>department</dt><dd>[[+dep]]</dd>
<dt>Title</dt><dd>[[+title]]</dd>
<dt>Telephone</dt><dd>[[+telephone]]</dd>
<dt>Email</dt><dd>[[+email]]</dd>
<dt>Photo</dt><dd><img src="[[+photo]]" alt="[[+name]]" title="[[+dep]]"/></dd>
</dl>
</li>
`:else=``]]
function filterItems($where,$items)
[[+property.contact]]
I changed:
function filterItems($items)
To:
function filterItems($where,$items)


This discussion is closed to further replies. Keep calm and carry on.