logo-dw

Go Back   Dreamweaver Club Forums > Community Talk > Dreamweaver Club Cafe
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 05-28-2008, 08:52 PM   #1
oregon_sv
 
Join Date: Jun 2007
Posts: 49
Default Having trouble with ext js

Hello,

i have a grid which show three kinds of data. String, Float, String.
in the database the colums are named like Codigo,CostoUni,Usuario.
and those has the values 002 ,1.23, john
but in the grid values show 2 insted of '002'
the costoUni value its show good.
but in the usuario fields when it has a number value it shows the data but when the value is a string like 'jonh' it says :
char : 2
error : 'jonh' is undefined
code : 0

the code is below:

Code:
 
 
function main() {
// 1. Create some dummy data data 
var sampleData = [
[<?php do {?>],
[<?php echo $linea['codigo']?>,<?php echo $linea['costouni']?>,<?php echo $linea['usuario']?>],
[<?php }while ($linea =@mysql_fetch_array($result)) ?>] 
];
// 2. Create the Store 
var store = new Ext.data.SimpleStore({ 
fields : [
{ name: 'codigo', type: 'string' },
{ name: 'costouni', type: 'float' },
{ name: 'usuario', type: 'string' }
],
data: sampleData
});
 
// 3. Initialize the grid control
var simpleGrid = new Ext.grid.EditorGridPanel({
store: store,
columns: [{
header: 'Codigo', // 4. Field cannot be edited.
width: 70, 
sortable: false, 
dataIndex: 'codigo'
},
{
header: 'Costo Unitario', // 5. Field can be edited
width: 70, 
sortable: false, 
dataIndex: 'costouni' 
},
{
header: 'Usuario', // 4. Field cannot be edited.
width: 70, 
sortable: false, 
dataIndex: 'usuario'
} 
],
clicksToEdit: 1,
stripeRows: true,
autoHeight:false,
height:300,
width:500,
enableHdMenu: false, // 7. Disable the context menu
title:'Editor Grid OREGONSV',
renderTo: 'formDiv'
});
Can you help me please,

Atte,

Alberto Orellana,
http://www.oregonsv.pcriot.com/es/cwdefault.html
oregon_sv is offline   Reply With Quote
Old 05-28-2008, 09:32 PM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

im playing with this framework myself

it seems that your app is having trouble with...

type: 'string'

it may default to string so try to omit the type decleration...

type: ''
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 05-28-2008, 09:59 PM   #3
oregon_sv
 
Join Date: Jun 2007
Posts: 49
Default

i tried, but it does not work,

this is the original code. and its works.
function main() {
// 1. Create some dummy data data
var sampleData = [
[ 'Bob', 100, <?php echo $lineactualiza['valoruni']?> ],
[ 'Bill', 200, 12.92],
[ 'Mike', 300, 23.02]
];
// 2. Create the Store
var store = new Ext.data.SimpleStore({
fields : [
{ name: 'name', type: 'string' },
{ name: 'hours', type: 'int' },
{ name: 'rate', type: 'float' },
{ name: 'cost', type: 'float' }
],
data: sampleData
});

but i tried to show the data from the data base and i cant.

thank u
oregon_sv is offline   Reply With Quote
Old 05-28-2008, 10:54 PM   #4
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

i have to bow out as i am just a nubee with this framework

i will have a look at the weekend if you dont get it sorted

if you sort it post the resolution
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:53 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com