[jQuery] Re: Jquery + ExtJS 3.0

2009-08-24 Thread mikfig

thanks,
that solved it :D

On Aug 23, 11:49 pm, Steven Yang kenshin...@gmail.com wrote:
 try switching the order of script type=text/javascript
 src=...ext-all.js/script
 script type=text/javascript src=...ext-jquery-adapter.js/script

 to
 script type=text/javascript src=...ext-jquery-adapter.js/script
 script type=text/javascript src=...ext-all.js/script


[jQuery] Jquery + ExtJS 3.0

2009-08-23 Thread mikfig

Has anyone had any luck integrating Jquery and ExtJS 3.0? I downloaded
the ExtJS 3.0 SDK and I have a page where I am trying to test out
there grid functionality. So I included these javascript files:
ext-all.js and ext-jquery-adapter.js

I have taken a look in the Jquery documentation at the page

Tutorials:Using Ext With jQuery

For one thing I couldn't find jquery-plugins.js with the ExtJS SDK,
but i figured that since im using version 3.0 versus the 1.0.1 that is
used in this tutorial that this was all in ext-jquery-adapter.js.

But anyways, when I include ext-all.js, Firebug gives me this error:
Ext is not defined

I am including these javascript files in the middle of the body tag
inside of a div, so I'm not sure if this could also possibly be a
cause of the problem.

Any help would be appreciated,
Thanks,
Mikael


[jQuery] Re: Jquery + ExtJS 3.0

2009-08-23 Thread mikfig

html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
head
...
script type=text/javascript src=...jquery-1.2.6.pack.js/
script
script type=text/javascript src=...jquery-ui-
personalized-1.5.3.packed.js/script
...
/head
body
...
div
link type=text/css href=...ext-all.css /
script type=text/javascript src=...ext-all.js/script
script type=text/javascript src=...ext-jquery-adapter.js/
script
script type=text/javascript
!--
$(document).ready(function()
{
var myData = [
['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am']
];
var store = new Ext.data.ArrayStore({
fields: [
   {name: 'company'},
   {name: 'price', type: 'float'},
   {name: 'change', type: 'float'},
   {name: 'pctChange', type: 'float'},
   {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
]
});
store.loadData(myData);
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{id:'company',header: Company, width: 160, sortable:
true, dataIndex: 'company'},
{header: Price, width: 75, sortable: true, renderer:
'usMoney', dataIndex: 'price'},
{header: Change, width: 75, sortable: true, renderer:
change, dataIndex: 'change'},
{header: % Change, width: 75, sortable: true, renderer:
pctChange, dataIndex: 'pctChange'},
{header: Last Updated, width: 85, sortable: true,
renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex:
'lastChange'}
],
stripeRows: true,
autoExpandColumn: 'company',
height:350,
width:600,
title:'Array Grid'
});
grid.render('grid-example');
});
//--
/script

div id=grid-example/div
/div


On Aug 23, 5:20 pm, Meroe whme...@gmail.com wrote:
 Post your file text please so we can see the layout.  There is a no conflict
 setting for jquery, but you don't seem to be registering the ext library
 yet.

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

 Behalf Of Mik Fig
 Sent: Sunday, August 23, 2009 4:37 PM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Jquery + ExtJS 3.0

 Has anyone had any luck integrating Jquery and ExtJS 3.0?
 I downloaded the ExtJS 3.0 SDK and I have a page where I am trying to
 test out there grid functionality. So I included these javascript files:
 ext-all.js and ext-jquery-adapter.js

 I have taken a look in the Jquery documentation at the page

 Tutorials:Using Ext With jQuery

 For one thing I couldn't find jquery-plugins.js with the ExtJS SDK,
 but i figured that since im using version 3.0 versus the 1.0.1 that is
 used in this tutorial that this was all in ext-jquery-adapter.js.

 But anyways, when I include ext-all.js, Firebug gives me this error:
 Ext is not defined

 I am including these javascript files in the middle of the body tag
 inside of a div, so I'm not sure if this could also possibly be a
 cause of the problem.

 Any help would be appreciated,
 Thanks,
 Mikael


[jQuery] Issue with setting click event functions in a for loop

2009-05-16 Thread mikfig

I have a webpage that searches a database using a php script to search
the database and a jQuery app on the page to retrieve the results and
show them. So it works fine, but then I want to add page number
buttons to allow the user to go to different pages of the results.
So I have a DIV with the id of page_buttons and I use the following
code: http://pastebin.com/m3dffbf99

I use the offset and the results per page like this in a MySQL query
in the php script: SELECT  LIMIT offset,
resultsPerPage by the way.

So anyways, the problem I am having is that if I have a loop like
this:

var pageNum = 6;
...
for(var i = 0; i = pageNum; ++i)
{
$(#page + i).click(function() { alert('page ' + i + '
clicked.'); });
}

The elements with IDs of page1, page2,... are buttons, and I
tested the above loop. What happens is if I click any of the buttons
with IDs of page1, page2,.. then they all alert with the string
page 7 clicked. All the page buttons 1-6 display the string page 7
clicked.

To try to greater understand this problem I took the functionality out
of the loop like this:

var i = 2;
$(#page + i).click(function() { alert('page ' + i + '
clicked.'); });
i = 3;
$(#page + i).click(function() { alert('page ' + i + '
clicked.'); });

and it worked just fine with page2 alerting page 2 clicked and
page3 alerting with page 3 clicked.

So I was hoping someone could help me in explaining why this issue
occurs and if there was a better way to do what I'm trying to do.

Thanks,
mikfig