Re: [Catalyst] Jason Kohles' tutorial on ExtJs editable data gridsand Catalyst

2009-04-18 Thread jagdish eashwar
Hi Craig,

Thanks a lot for taking the trouble to work through the tutorial. Since you
have been able to get it to save changes to the database, I think we will be
able to isolate where I'm going wrong.

Regarding whether to use  'Catalyst'  or  'c' as the context, when I created
the TT view with the Catalyst helper command
'script/adventajaxgrid_create.pl view TT TTSite', it automatically set the
CATALYST_VAR = 'Catalyst'. I changed this to 'c', and the
'Catalyst.uri_for' to 'c.uri_for'. The Ext Grid behaves just like before. It
does everything except the Save.

Can you paste your root/static/advent.js and your View/JSON.pm ? I would
like to compare it with what I have done.

Jagdish

On Sat, Apr 18, 2009 at 1:46 AM, Craig McLaughlin c...@bitbucket.com wrote:



 Howdy,

 So for grins and giggles I ran through the demo and brute forced it until
 it worked (this doesn't imply anything other than I'm not a rocket
 scientist with this stuff and that I'm really good at making dumb
 mistakes).

 I am running the following: ubuntu 8.04, Catalyst 5.71001, ExtJS 2.2.1.

 I had to change Catalyst.uri_for to c.uri_for in index.tt2 (I believe you
 can also get around this by setting
 CATALYST_VAR = 'Catalyst' in your config somewhere.  I chose to use 'c' as
 that's my default these days.

 Other than that, I had a few issues making sure my js functions were in the
 right place, but that was it (I am not a .js guy by nature).

 I was able to successfully add and edit people, and changes were reflected
 in the database [tested by command line:
  'sqlite3 advent.db select * from people' ]

 If I were in your shoes, I'd probably take another look at getting your
 Catalyst / c situation figured out.

 Sorry this isn't a direct answer... here's hoping at least a 'here's what I
 did and it worked' helps a bit.

 Cheers,
 --Craig

 On Fri, 17 Apr 2009 14:38:43 +0530, jagdish eashwar
 jagdish.eash...@gmail.com wrote:
  Hi Ian,
 
  I am using ubuntu 8.04 and firefox 2 and no firebug because on my ubuntu
  installation firefox 3 hangs and I am unable to install a version of
  firebug
  that is compatible with firefox 2. In the absence of firebug, I looked
 for
  the javascript errors in the firefox error log and there were none.
  I am hoping that when ubuntu 9.04 is released a little later this month,
 I
  will be able to start using firefox 3 and firebug.
  I am working through Jason Kohle's tutorial on a single computer. It's a
  good tutorial and all of it 'just worked' except for saving changes back
  to
  the database.
  On Fri, Apr 17, 2009 at 12:27 PM, Ian Docherty
  catal...@iandocherty.comwrote:
 
 
  jagdish eashwar wrote:
 
  Hi,
  No I don't get any javascript error in the error log when I hit
  'save',
  and it doesn't save the changes in the database either. Just nothing
  happens.
 
  This might be obvious to you in which case I apologise, javascript
  errors
  do not appear in the (server) error log file. You need to check for
  errors
  client side.
 
  Are you using something like Firefox and FireBug to test your javascript
  on
  your browser?
 
  Regards
  Ian
 
 
  On Thu, Apr 16, 2009 at 9:34 PM, W. Tyler Gee geek...@gmail.com
  mailto:
  geek...@gmail.com wrote:
 
 Is there a javascript error when you hit save or is it getting to
 the server? Where is your actual problem?
 
 
 On Thu, Apr 16, 2009 at 5:30 AM, jagdish eashwar
  jagdish.eash...@gmail.com mailto:jagdish.eash...@gmail.com
  wrote:
 
 Hi Peter,
 Thanks for writing in. It is really not my code at all. I have
 taken it all from the tutorial. I thought that people will get
 a better perspective if I referred them to the tutorial.
 Nevertheless, I am pasting code from the advent.js file below.
 ( I have made a few inconsequential changes though, like the
 values in the drop down etc.)
 
 /*
  * advent.js
  */
 
 Ext.onReady(function() {
 
  var col_model = new Ext.grid.ColumnModel([
 {
 id: 'id',
 header: 'ID',
 dataIndex:  'id',
 width:  40
 },
 {
 id: 'name',
 header: 'Name',
 dataIndex:  'name',
 editor: new Ext.form.TextField({
 allowBlank: false,
 })
 },
 {
 id: 'occupation',
 header: 'Occupation',
 dataIndex:  'occupation',
 width:  70,
 editor: new Ext.form.ComboBox({
 typeAhead:  true,
 triggerAction:  'all',
 transform:  'occpopup',
 lazyRender: true,
 listClass:  

Re: [Catalyst] Jason Kohles' tutorial on ExtJs editable data gridsand Catalyst

2009-04-18 Thread Peter Karman

jagdish eashwar wrote:

Hi Craig,

Thanks a lot for taking the trouble to work through the tutorial. 
Since you have been able to get it to save changes to the database, I 
think we will be able to isolate where I'm going wrong.


Regarding whether to use  'Catalyst'  or  'c' as the context, when I 
created the TT view with the Catalyst helper command 
'script/adventajaxgrid_create.pl view TT TTSite', it automatically set 
the CATALYST_VAR = 'Catalyst'. I changed this to 'c', and the 
'Catalyst.uri_for' to 'c.uri_for'. The Ext Grid behaves just like 
before. It does everything except the Save.


Can you paste your root/static/advent.js and your View/JSON.pm ? I 
would like to compare it with what I have done.
Did you try commenting out the 'console.log' line as someone else 
suggested?


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Jason Kohles' tutorial on ExtJs editable data gridsand Catalyst

2009-04-18 Thread jagdish eashwar
Hi Peter, Scott and Craig,
Thanks a lot. Commenting out 'console.log' worked. It works irrespective of
whether I use 'Catalyst.uri_for' or 'c.uri_for'. I guess that line can be
there only if one is using firebug. And I think  the tutorial code worked
for Craig because he  was using firebug. Is that right Craig? Thanks to
Scott for being so perceptive and to Peter for being persistent.

Jagdish

On Sun, Apr 19, 2009 at 7:53 AM, Peter Karman pe...@peknet.com wrote:

 jagdish eashwar wrote:

 Hi Craig,

 Thanks a lot for taking the trouble to work through the tutorial. Since
 you have been able to get it to save changes to the database, I think we
 will be able to isolate where I'm going wrong.

 Regarding whether to use  'Catalyst'  or  'c' as the context, when I
 created the TT view with the Catalyst helper command
 'script/adventajaxgrid_create.pl view TT TTSite', it automatically set the
 CATALYST_VAR = 'Catalyst'. I changed this to 'c', and the
 'Catalyst.uri_for' to 'c.uri_for'. The Ext Grid behaves just like before. It
 does everything except the Save.

 Can you paste your root/static/advent.js and your View/JSON.pm ? I would
 like to compare it with what I have done.

 Did you try commenting out the 'console.log' line as someone else
 suggested?


 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Jason Kohles' tutorial on ExtJs editable data gridsand Catalyst

2009-04-17 Thread Craig McLaughlin


Howdy,

So for grins and giggles I ran through the demo and brute forced it until
it worked (this doesn't imply anything other than I'm not a rocket
scientist with this stuff and that I'm really good at making dumb
mistakes).

I am running the following: ubuntu 8.04, Catalyst 5.71001, ExtJS 2.2.1.

I had to change Catalyst.uri_for to c.uri_for in index.tt2 (I believe you
can also get around this by setting
CATALYST_VAR = 'Catalyst' in your config somewhere.  I chose to use 'c' as
that's my default these days.

Other than that, I had a few issues making sure my js functions were in the
right place, but that was it (I am not a .js guy by nature).

I was able to successfully add and edit people, and changes were reflected
in the database [tested by command line: 
  'sqlite3 advent.db select * from people' ]

If I were in your shoes, I'd probably take another look at getting your
Catalyst / c situation figured out.

Sorry this isn't a direct answer... here's hoping at least a 'here's what I
did and it worked' helps a bit.

Cheers,
--Craig

On Fri, 17 Apr 2009 14:38:43 +0530, jagdish eashwar
jagdish.eash...@gmail.com wrote:
 Hi Ian,
 
 I am using ubuntu 8.04 and firefox 2 and no firebug because on my ubuntu
 installation firefox 3 hangs and I am unable to install a version of
 firebug
 that is compatible with firefox 2. In the absence of firebug, I looked
for
 the javascript errors in the firefox error log and there were none.
 I am hoping that when ubuntu 9.04 is released a little later this month,
I
 will be able to start using firefox 3 and firebug.
 I am working through Jason Kohle's tutorial on a single computer. It's a
 good tutorial and all of it 'just worked' except for saving changes back
 to
 the database.
 On Fri, Apr 17, 2009 at 12:27 PM, Ian Docherty
 catal...@iandocherty.comwrote:
 

 jagdish eashwar wrote:

 Hi,
 No I don't get any javascript error in the error log when I hit 
 'save',
 and it doesn't save the changes in the database either. Just nothing
 happens.

 This might be obvious to you in which case I apologise, javascript
 errors
 do not appear in the (server) error log file. You need to check for
 errors
 client side.

 Are you using something like Firefox and FireBug to test your javascript
 on
 your browser?

 Regards
 Ian


 On Thu, Apr 16, 2009 at 9:34 PM, W. Tyler Gee geek...@gmail.com
 mailto:
 geek...@gmail.com wrote:

Is there a javascript error when you hit save or is it getting to
the server? Where is your actual problem?


On Thu, Apr 16, 2009 at 5:30 AM, jagdish eashwar
 jagdish.eash...@gmail.com mailto:jagdish.eash...@gmail.com
 wrote:

Hi Peter,
Thanks for writing in. It is really not my code at all. I have
taken it all from the tutorial. I thought that people will get
a better perspective if I referred them to the tutorial.
Nevertheless, I am pasting code from the advent.js file below.
( I have made a few inconsequential changes though, like the
values in the drop down etc.)

/*
 * advent.js
 */

Ext.onReady(function() {

 var col_model = new Ext.grid.ColumnModel([
{
id: 'id',
header: 'ID',
dataIndex:  'id',
width:  40
},
{
id: 'name',
header: 'Name',
dataIndex:  'name',
editor: new Ext.form.TextField({
allowBlank: false,
})
},
{
id: 'occupation',
header: 'Occupation',
dataIndex:  'occupation',
width:  70,
editor: new Ext.form.ComboBox({
typeAhead:  true,
triggerAction:  'all',
transform:  'occpopup',
lazyRender: true,
listClass:  'x-combo-list-small'
})
}
]);

col_model.defaultSortable = true;


var People = Ext.data.Record.create([
{ name:'id',type: 'int'},
{ name: 'name',type: 'string'},
{ name: 'occupation',type: 'string'}
]);


var store = new Ext.data.JsonStore({
url: gridurl,
root: 'people',
fields: People
});

var grid = new Ext.grid.EditorGridPanel({
store:  store,
cm: col_model,
title:  'Edit Persons',
width:  600,
height: 300,
frame:  true,
autoExpandColumn:   'name',