it--solutions
Posts: 24
|
| Posted: 09/09/2007, 5:47 PM |
|
As most newer code charge users the frustration level keeps growing, take me back to raw code!
anyway my problem.......
i have a table that has a grid that queries a mysql db and displays the result correctly.
if there is no record it displays "no record" i would rather it to display a button that says "Add new information" that links to a form, is this possible easily?
|
 |
 |
datadoit.com
|
| Posted: 09/09/2007, 7:23 PM |
|
it--solutions wrote:
> As most newer codecharge users the frustration level keeps growing, take me back
> to raw code!
>
> anyway my problem.......
>
> i have a table that has a grid that queries a mysql db and displays the result
> correctly.
> if there is no record it displays "no record" i would rather it to display a
> button that says "Add new information" that links to a form, is this possable
> easily?
> ---------------------------------------
Yes this is easy in CCS. After the grid (outside of the <!-- BEGIN Grid
--><!-- END Grid --> tags in the HTML), add a link for 'Add New
Information', set it to point to your page where your add form is, and
set it's visibility to Dynamic. In your grid's BeforeShow event, add:
global $AddNewInformationLink; //or whatever you called it.
if ($Container->ds->RecordsCount == 0) {
$Container->Visible = false;
$AddNewInformationLink->Visible = true;
}
else {
$AddNewInformationLink->Visible = false;
}
If you want your link to look like a button, use a button style for it.
There are several other ways to do this also, but this is probably the
quickest way from point A to point B.
|
|
|
 |
wkempees
|
| Posted: 09/10/2007, 5:06 AM |
|
datadoit, weel put.
Other approach:
using the builder, create a new page, grid + form.
Steal the code from there. 
"datadoit.com" <datadoit@forum.codecharge> schreef in bericht
news:fc29rf$19s$1@news.codecharge.com...
> it--solutions wrote:
>> As most newer codecharge users the frustration level keeps growing, take
>> me back
>> to raw code!
>>
>> anyway my problem.......
>>
>> i have a table that has a grid that queries a mysql db and displays the
>> result
>> correctly.
>> if there is no record it displays "no record" i would rather it to
>> display a
>> button that says "Add new information" that links to a form, is this
>> possable
>> easily?
>> ---------------------------------------
>
> Yes this is easy in CCS. After the grid (outside of the <!-- BEGIN
> Grid --><!-- END Grid --> tags in the HTML), add a link for 'Add New
> Information', set it to point to your page where your add form is, and set
> it's visibility to Dynamic. In your grid's BeforeShow event, add:
>
> global $AddNewInformationLink; //or whatever you called it.
>
> if ($Container->ds->RecordsCount == 0) {
> $Container->Visible = false;
> $AddNewInformationLink->Visible = true;
> }
> else {
> $AddNewInformationLink->Visible = false;
> }
>
> If you want your link to look like a button, use a button style for it.
> There are several other ways to do this also, but this is probably the
> quickest way from point A to point B.
|
|
|
 |
Damian Hupfeld
|
| Posted: 10/13/2007, 12:59 AM |
|
Easier way still - locate the No Record in the HTML view and replace it with
your button link.
"wkempees" <kempe819@planet.nl> wrote in message
news:fc3bvu$kbr$1@news.codecharge.com...
> datadoit, weel put.
> Other approach:
> using the builder, create a new page, grid + form.
> Steal the code from there. 
>
> "datadoit.com" <datadoit@forum.codecharge> schreef in bericht
>news:fc29rf$19s$1@news.codecharge.com...
>> it--solutions wrote:
>>> As most newer codecharge users the frustration level keeps growing, take
>>> me back
>>> to raw code!
>>>
>>> anyway my problem.......
>>>
>>> i have a table that has a grid that queries a mysql db and displays the
>>> result
>>> correctly.
>>> if there is no record it displays "no record" i would rather it to
>>> display a
>>> button that says "Add new information" that links to a form, is this
>>> possable
>>> easily?
>>> ---------------------------------------
>>
>> Yes this is easy in CCS. After the grid (outside of the <!-- BEGIN
>> Grid --><!-- END Grid --> tags in the HTML), add a link for 'Add New
>> Information', set it to point to your page where your add form is, and
>> set it's visibility to Dynamic. In your grid's BeforeShow event, add:
>>
>> global $AddNewInformationLink; //or whatever you called it.
>>
>> if ($Container->ds->RecordsCount == 0) {
>> $Container->Visible = false;
>> $AddNewInformationLink->Visible = true;
>> }
>> else {
>> $AddNewInformationLink->Visible = false;
>> }
>>
>> If you want your link to look like a button, use a button style for it.
>> There are several other ways to do this also, but this is probably the
>> quickest way from point A to point B.
>
>
|
|
|
 |
|