Delphi For PHP Forums       


Go Back   Delphi-PHP Forums > Programming > Javascript and Ajax
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

Javascript and Ajax Questions and information about working with Ajax and Javascript in Delphi for PHP.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 17th March 2009, 10:12
D4PHP User
 
Join Date: Jan 2009
Posts: 11
Lucas.frey is on a distinguished road
Default Limit of Javascript

Hi,

I've got a problem with javascript who seems to limite my developping, i explain :

I need to show some value came from a row in a DBGrid, in Edit, Combobox and lot of things, so I've decided to use Javascript and code like that for the moment :

function JSRowChanged($sender, $params)
{

?>

document.GestTC.edCommercial.value = DBGridAffaire_Liste.getTableModel().getValue(6, DBGridAffaire_Liste.getFocusedRow());
document.GestTC.edNumero_Affaire.value = DBGridAffaire_Liste.getTableModel().getValue(0, DBGridAffaire_Liste.getFocusedRow());
document.GestTC.edRef_Client.value = DBGridAffaire_Liste.getTableModel().getValue(1, DBGridAffaire_Liste.getFocusedRow());
document.GestTC.dtCreation_Affaire.value = DBGridAffaire_Liste.getTableModel().getValue(5, DBGridAffaire_Liste.getFocusedRow());
document.GestTC.cbAffaire_Origine.value = DBGridAffaire_Liste.getTableModel().getValue(3, DBGridAffaire_Liste.getFocusedRow());
document.GestTC.cbAffaire_Mode_Contact.value = DBGridAffaire_Liste.getTableModel().getValue(4, DBGridAffaire_Liste.getFocusedRow());
document.GestTC.cbAffaire_Client.value = DBGridAffaire_Liste.getTableModel().getValue(1, DBGridAffaire_Liste.getFocusedRow());
document.GestTC.edAffaire_Interlocuteur.value = DBGridAffaire_Liste.getTableModel().getValue(7, DBGridAffaire_Liste.getFocusedRow());
document.GestTC.Edit6.value = DBGridAffaire_Liste.getTableModel().getValue(1, DBGridAffaire_Liste.getFocusedRow());
<?php

}

I use the function JSRowChanged to do that, my problem is that the third componements work fine, but the other do not, it change only the third lign, the other componement do nothing. so i'm stuck, is this javascript problem ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 17th March 2009, 12:02
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,271
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

I don't understand exactly what your problem is so a little clarification may be needed.

When js hits an error it just stops and nothing else happens so perhaps that is your problem. Firebug in firefox will tell you if you are getting an error.

My guess is you are trying to access or change a component in a way that doesn't work so it errors and stops.

From a speed standpoint I would make a couple of changes to your code so the functions are not called every time.
Code:
var model=DBGridAffaire_Liste.getTableModel();
var row=DBGridAffaire_Liste.getFocusedRow();
document.GestTC.edCommercial.value =model.getValue(6, row);
document.GestTC.edNumero_Affaire.value =model.getValue(0, row);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 22:47.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use