RoyBaird
Posts: 115
|
| Posted: 07/29/2008, 4:01 PM |
|
I have made this trick work in ASP, but I need it to work in PHP. I followed the example in the Example Pack, I think, twice and I still get no page when I load it. The status bar says "done", but there is nothing on the page. Is there a bug in the example pack?
Thanks,
Roy
_________________
Roy |
 |
 |
Niflheim
Posts: 5
|
| Posted: 07/30/2008, 1:52 AM |
|
hy,
also trying to implement this :D.
i`m stuck at smth else
# Add Custom Code to the On Click client side event of the Add Row Button as shown in the example.
# Add Custom Code to the Before Show Row and Before Execute Delete server events of the editable grid form and add a RowNumber global variable as shown in the example.
this is what i got from the site.
the question is:
where is the code :D
i mean the examples aren`t complete? or i did not find the code ?
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 07/30/2008, 4:26 AM |
|
Example pack comes with CCS.
Example Pack2 is downloadable from user area for registered CCS users.
When example opened in CCS Design, all the code is visible in the respective locations.
Most of the example expanations do point to that.
Walter`
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 07/30/2008, 4:34 AM |
|
@Nilfheim:
The Editable grid with AddRow button is Example Pack1, comes with CCS.
Startup CCS, when asked :
New Project.
Tab: Solutions will show you Example Pack
Click that and CCS will (after a few questions) show you the application ready for publishing.
Now you can acces the various parts the example text directs you to and see the code.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 07/30/2008, 4:35 AM |
|
@Roy
If you follow above directions to recreate example, does it still not function?
What version CCS you on?
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
RoyBaird
Posts: 115
|
| Posted: 07/30/2008, 5:36 AM |
|
Version 3.2.0.2 CCS
In past applications using ASP, I have made this work. With PHP, the screen is empty with no messages and DONE in the status bar. It must have something to do with the BEFORE SHOW ROW, but I can't seem to find it. I copied the code from the Example Pack. The one area that always give me heartburn is in the HTML changes where an attibute needs to be added. The doc says id and NAME , but the example code is id and TITLE. This project calls for 1 page with a master record and 3 editable grids of detail data.
Thanks,
Roy
_________________
Roy |
 |
 |
Niflheim
Posts: 5
|
| Posted: 07/30/2008, 6:13 AM |
|
@wkempees thanks :D
|
 |
 |
RoyBaird
Posts: 115
|
| Posted: 07/30/2008, 9:21 AM |
|
Ok. I have the page showing up with data. I click the Add Row button.... nothing happens....
I have triple checked the code. Is there something the doc does not tell you to do?
I can paste in the code here if that would help.
Thanks,
Roy
_________________
Roy |
 |
 |
wkempees
Posts: 1679
|
| Posted: 07/31/2008, 2:21 AM |
|
Roy
Show us the code........
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
RoyBaird
Posts: 115
|
| Posted: 07/31/2008, 7:23 AM |
|
Ok. here it comes..
The Table is "Authors". The page is also "Authors".
Client side onclick:
//page_Authors_AddRowBtn_OnClick @13-2D066131
function page_Authors_AddRowBtn_OnClick()
{
var result;
//End page_Authors_AddRowBtn_OnClick
//Custom Code @17-2A29BDB7
var NS6 = (!document.all && document.getElementById) ? 1 : 0;
var IE = (document.all) ? 1 : 0;
var FormState = document.Authors.FormState.value.split(";");
var AllLength = parseInt(FormState[0])+parseInt(FormState[1]);
if (parseInt(FormState[0]) == 0 ) {
FormState[0] = 1;
}
var i;
for (i=FormState[0]; i<AllLength; i++) {
var objRow = document.getElementById('row' + i);
if (NS6) {
if (objRow.style.display == "none") {
objRow.style.display = '';
break;
}
} else {
if (objRow.style.display == "none") {
objRow.style.display = "block";
break;
}
}
}
if (i >= AllLength)
document.forms["Authors"].AddRowBtn.disabled = true;
//End Custom Code
HTML Lables:
<tr class="row" id="{RowIDAttribute}" name="{RowNameAttribute}" {RowStyleAttribute}>
BeforeShowRow:
//Authors_BeforeShowRow @2-DADF39B3
function Authors_BeforeShowRow(& $sender)
{
$Authors_BeforeShowRow = true;
$Component = & $sender;
$Container = & CCGetParentContainer($sender);
global $Authors; //Compatibility
//End Authors_BeforeShowRow
//Custom Code @18-2A29BDB7
// -------------------------
global $Authors;
global $RowNumber;
//Increase the row number and set it within the HTML
$RowNumber++;
$Authors->RowIDAttribute->SetValue($RowNumber);
//Configure the row's properties based on its state (empty or filled)
if (($RowNumber <= $Authors->PageSize) && ($RowNumber <= $Authors->ds->RecordsCount)) {
$Authors->RowNameAttribute->SetValue("FillRow");
} else {
$Authors->RowNameAttribute->SetValue("EmptyRow");
$Authors->RowStyleAttribute->SetValue("style=\"display:none;\"");
if($Authors->RowsErrors[$RowNumber]) {
$Authors->RowStyleAttribute->SetValue("");
}
}
//End Custom Code
//Close Authors_BeforeShowRow @2-2E1D0E93
return $Authors_BeforeShowRow;
}
//End Close Authors_BeforeShowRow
I am not concerned with the BeforeExecuteDelete at this time. Want to get the "add row" working first.
As always, Thanks!!!!
_________________
Roy |
 |
 |
thumrith
Posts: 1
|
| Posted: 10/10/2008, 10:02 PM |
|
same problem nothing happens
whats the code behind the new row show global variable ????
I think the prob is that
_________________
thumrith |
 |
 |