PDA

View Full Version : unable to open zip file example



YankeeImperialistDog
12 Nov 2009, 7:23 AM
http://www.extjs.com/learn/Tutorial:Loading_Data_Into_and_Submitting_a_Form

this zip appears to be invalid. I am able to open some of the othewr zips from this site.

VinylFox
12 Nov 2009, 7:26 AM
I can open the zip file just fine, im using WinRar.

Did you realize that's an example for ExtJS 1.1 ?

YankeeImperialistDog
12 Nov 2009, 7:39 AM
Thanks for getting back so soon. I did realise it's a 1.1. I'm using 3.0.x version and it could be this will not even work on my version.

I'm looking for a simple complete example of loading a form with JSON values returned from a Controler action (MVC.NET) and thought this would at least give me the basics. A lot of examples are demonstrating good programing practice, but to someone new to this it helps to have an all in one ext.onReady example just to show the steps involved. This is not best practice, but it's the learn to walk before you run answer i'm looking for.

(I saved this zip to disk and it still will not open. Can i just get the un ziped version some place, or should i just scrap it because it's too out dated?)

VinylFox
12 Nov 2009, 7:56 AM
Yeah, it should help. I think most of it will still work.

I re-zipped the files with a different program, hope this works for you.

YankeeImperialistDog
12 Nov 2009, 8:04 AM
well, i may have discovered a Windows 7 bug. I downloaded winrar and it opened. This had nothing to do with the zip. Thanks!

jay@moduscreate.com
12 Nov 2009, 8:08 AM
If you're looking to learn about forms, etc, check out Shea's book.

http://www.learningextjs.com/

YankeeImperialistDog
12 Nov 2009, 8:10 AM
Is that de-compressed file encrypted? Win rar opens it but it's not text. What's up with this?

jay@moduscreate.com
12 Nov 2009, 8:15 AM
Works fine for me!

jay@moduscreate.com
12 Nov 2009, 8:16 AM
forms-submit.js

/**
* @author Shea Frederick
*/

// this formatter function will help us deal
// with unexpected ideas of what boolean means
Ext.util.Format.boolean = function(v) {
switch(v) {

case 1:
case "1":
case true:
case "Yes":
case "yes":
case "True":
case "true":
return true;
break;
default:
return false;

}
}

Ext.onReady(function(){

Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';

var form_employee = new Ext.form.Form({
labelAlign: 'right',
labelWidth: 175,
url:'forms-submit-process.php',
buttonAlign: 'right'
});

var employee_name = new Ext.form.TextField({
fieldLabel: 'Name',
name: 'name',
width:190
});

var employee_title = new Ext.form.TextField({
fieldLabel: 'Title',
name: 'title',
width:190
});

var employee_hire_date = new Ext.form.DateField({
fieldLabel: 'Hire Date',
name: 'hire_date',
width:90,
allowBlank:false,
format:'m-d-Y'
});

var employee_active = new Ext.form.Checkbox({
fieldLabel: 'Active',
name: 'active'
});

form_employee.fieldset(
{legend:'Employee Edit'},
employee_name,
employee_title,
employee_hire_date,
employee_active
)

employee_data = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: 'forms-submit-getdata.php?id=14'}),
reader: new Ext.data.JsonReader({},[ 'id', 'name', 'title', 'hire_date', 'active']),
remoteSort: false
});

employee_data.on('load', function() {

employee_name.setValue(employee_data.getAt(0).data.name);
employee_title.setValue(employee_data.getAt(0).data.title);
employee_hire_date.setValue(employee_data.getAt(0).data.hire_date);
employee_active.setValue(Ext.util.Format.boolean(employee_data.getAt(0).data.active));

form_employee.addButton('Save', function(){
if (form_employee.isValid()) {
form_employee.submit({
params:{
action:'submit',
id:employee_data.getAt(0).data.id
},
waitMsg:'Saving...'
});
}else{
Ext.MessageBox.alert('Errors', 'Please fix the errors noted.');
}
}, form_employee);

form_employee.render('employee-form');

});

employee_data.load();

});

VinylFox
12 Nov 2009, 8:18 AM
Is that de-compressed file encrypted? Win rar opens it but it's not text. What's up with this?

No password. I have never seen anyone have so many issues with a simple zip file. You sure you don't have a virus?

As for Jays comment, my book is written for ExtJS 2.x+ and definitely covers loading and submitting forms. I would suggest it as well, if your interested in learning ExtJS concepts for the first time.

VinylFox
12 Nov 2009, 8:22 AM
Almost forgot....all of my books examples are available on Google Code...

These two would be what your looking for:
Chapter3/12_forms_load_data.php (http://code.google.com/p/learning-extjs-book-samples/source/browse/trunk/Chapter3/12_forms_load_data.php)
Chapter3/11_forms_buttons_action.php (http://code.google.com/p/learning-extjs-book-samples/source/browse/trunk/Chapter3/11_forms_buttons_action.php)

YankeeImperialistDog
12 Nov 2009, 8:29 AM
This was a lot of help on a minor zip issue. Thank you IOU1!

KES.

i'll check the book, it seems like it's ok.

YankeeImperialistDog
12 Nov 2009, 11:29 AM
Windows 7, 64-bit, duo-quad, 8 gig, and an SSD. Brand new. It may be the size of the zip, but it's not the zip at issue. Something is odd with Windows 7. Others zips from this site open ok. You're posting got me to figure out my problem. I was trying to index and not on the jsonData object. this wirked fine:
employee_note.setValue(employee_data.reader.jsonData.Note);

jay@moduscreate.com
12 Nov 2009, 11:43 AM
http://www.gifanatics.com/files/jpics1wlZ7xSlrPR5ff6.gif

YankeeImperialistDog
12 Nov 2009, 12:16 PM
;)

YankeeImperialistDog
13 Nov 2009, 11:08 AM
This book is on slide share. This does not seem quite leagle. Did you know about this?

jay@moduscreate.com
13 Nov 2009, 11:10 AM
books are pirated like you would not believe.

VinylFox
13 Nov 2009, 12:01 PM
Yeah, I email file sharing sites a few times a month with removal notices. Can you send me a direct message with the URL where you found the slides shared.

YankeeImperialistDog
13 Nov 2009, 12:37 PM
*URL REMOVED*

I've a subscription to safaribooksonline and requested they include it. it's available in pdf for around $22 around somewhere. I at least hope that one is leagle.
;)

Thanks for all your help.