Pages

Wednesday 17 June 2015

<script type="text/javascript">
// Author: ideal-helper.com
// Description: Photo slideshow to add your photos and embed into your website and blog post.

var x=0;

function rotate(num){
fs=new Array("http://www.hdwallpapersmaza.com/wp-content/uploads/2013/11/bmw-car-d-blue-hd-90922.jpg",
"http://www.diplomatic-corporate-services.si/uploads/diplomatic-corporate-services.si_dev/MERCEDES_NOTRANJA_AUTO.jpg",
"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdN7Gnnye1Dc6rkiZGCAvD118DYkqkvdyUZ6DQbR25U3M4aKYOMLkl4OGoEh0ZtCWsXHqODrMK2eRE5CMyRgWRy4jrq9wWXUjsV6x8YMvzr20aI5wLHz-OtZBtelJQSfyzWrwcrm_Qooo/s1600/audi.jpg",
"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3IuMtmaq7nSAbV8zI3iow-yU0dAAY_rgef3x5J-yS-zB5CMnov812JTl8Nh1aPGMJ1hP1FX_5s3x5Et6qctD8JBxzhrQcPIQlD2-U4tgp-ITuydyCMedIQM_pIgnkcEvDE0mUlrCIax6S/s1600/new-dacia-duster-facelift-2014.jpg",
"http://www.carspicturesdb.com/wp-content/uploads/2012/10/Ford-focus-was-officially-revealed-today-at-the-detroit-auto.jpg");
x=num%fs.length;
if(x<0) x=fs.length-1;
document.images.show.src=fs[x];
}

function auto() {
rotate(++x);setTimeout("auto()", 2000);
}
</script>
<body onLoad="auto();"
<form name="ff">
<img name="show" width="643" height="361">
</form>
</body>
<script type="text/javascript">
// Author: ideal-helper.com
// Description: Photo slideshow to add your photos and embed into your website and blog post.

var x=0;

function rotate(num){
fs=new Array("http://www.hdwallpapersmaza.com/wp-content/uploads/2013/11/bmw-car-d-blue-hd-90922.jpg",
"http://www.diplomatic-corporate-services.si/uploads/diplomatic-corporate-services.si_dev/MERCEDES_NOTRANJA_AUTO.jpg",
"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdN7Gnnye1Dc6rkiZGCAvD118DYkqkvdyUZ6DQbR25U3M4aKYOMLkl4OGoEh0ZtCWsXHqODrMK2eRE5CMyRgWRy4jrq9wWXUjsV6x8YMvzr20aI5wLHz-OtZBtelJQSfyzWrwcrm_Qooo/s1600/audi.jpg",
"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3IuMtmaq7nSAbV8zI3iow-yU0dAAY_rgef3x5J-yS-zB5CMnov812JTl8Nh1aPGMJ1hP1FX_5s3x5Et6qctD8JBxzhrQcPIQlD2-U4tgp-ITuydyCMedIQM_pIgnkcEvDE0mUlrCIax6S/s1600/new-dacia-duster-facelift-2014.jpg",
"http://www.carspicturesdb.com/wp-content/uploads/2012/10/Ford-focus-was-officially-revealed-today-at-the-detroit-auto.jpg");
x=num%fs.length;
if(x<0) x=fs.length-1;
document.images.show.src=fs[x];
}

function auto() {
rotate(++x);setTimeout("auto()", 2000);
}
</script>
<body onLoad="auto();"
<form name="ff">
<img name="show" width="643" height="361">
</form>
</body>

ExtJS MVC Grid




Steps to Create Extjs MVC Application

1. Create a Project Folder (Example Name of the Project Folder  is 'MVC')
Please follow the below structure to create the files and folder with the Project Folder.

      MVC--->ExtJS Framework Folder
           |------>Index.html File
           |------>app.js File
           |------>app Folder
                         |--------------> controller Folder
                                                    |--------------------> MainController.js File
                         |--------------> view Folder
                                                    |--------------------> MainView.js File
                         |--------------> store Folder
                                                    |--------------------> MainStore.js File
                         |--------------> model Folder
                                                    |--------------------> MainModel.js File
                         |--------------> Application.js File

Index.html

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="C:\MVC\ext-5.1.0\packages\ext-theme-classic\build\resources\ext-theme-classic-all.css" type="text/css" rel="stylesheet"/>
<script src="C:\MVC\ext-5.1.0\build\ext-all-debug.js" type="text/javascript"></script>
<script src="C:\MVC\app.js" type="text/javascript"></script>
</head>

</html>

app.js

Ext.application({
name:'MVC',
extend:'MVC.Application',
autoCreateViewport:'MVC.view.MainView'

});

Application.js

Ext.define('MVC.Application',{
extend:'Ext.app.Application',
name:'MVC',
views:['MVC.view.MainView'],
controllers:['MVC.controller.MainController'],
stores:['MVC.store.MainStore']

});

MainController.js

Ext.define('MVC.controller.MainController',{
extend:'Ext.app.Controller',
models:['MVC.model.MainModel'],
stores:['MVC.store.MainStore'],
views:['MVC.view.MainView']

});

MainView.js

Ext.define('MVC.view.MainView',{
extend:'Ext.container.Viewport',
items:[{
xtype:'grid',
height:300,
title:'MVC Grid',
store:'MVC.store.MainStore',
columns:[{header:'First Name',dataIndex:'fname'},
{header:'Last Name',dataIndex:'lname'}]
}]

});

MainModel.js

Ext.define('MVC.model.MainModel',{
extend:'Ext.data.Model',
fields:[{name: 'fname', type: 'string'},
         {name: 'lname',  type: 'string'}]

});

MainStore.js

Ext.define('MVC.store.MainStore',{
extend:'Ext.data.Store',
model:'MVC.model.MainModel',
autoLoad:true,
/*proxy:{
type:'ajax',
url:'Data/name.json',
reader:{
type:'json'
}
}*/
data : [
         {fname: 'Ed',lname: 'Spencer'},
         {fname: 'Tommy', lname: 'Maintz'},
         {fname: 'Aaron', lname: 'Conran'},
         {fname: 'Jamie', lname: 'Avins'}
     ]

});