Shawn Mason
|
| Posted: 09/02/2002, 8:30 PM |
|
On a grid I have a couple fields that can grow quite large. I would like to
specify that the size of this row only expand to 2 or 3 rows versus enough
to show the entire contents (if the user needs the entire contents they can
go to the "view" page). So, I know I can change the value programmatically
in the "Before Show" event, but my question is does CCS have a builtin
property for this (I've looked and if it's there it's not obvious to me).
Just seeing if I can save myself some time in the future...
--
Kindest Regards,
Shawn Mason,CCD,MCP
I.S. Software Design Associates
|
|
|
 |
RonB
|
| Posted: 09/03/2002, 12:16 AM |
|
If you mean limiting the amount of records shown in a grid the answer is
yes. In the properties box, data, there is a records per page section in
wich you can specify the number of records to be shown. You can set this to
any amount you want.
RonB
"Shawn Mason" <shawn@issda.com> schreef in bericht
news:al1ac0$irg$1@news.codecharge.com...
> On a grid I have a couple fields that can grow quite large. I would like
to
> specify that the size of this row only expand to 2 or 3 rows versus enough
> to show the entire contents (if the user needs the entire contents they
can
> go to the "view" page). So, I know I can change the value
programmatically
> in the "Before Show" event, but my question is does CCS have a builtin
> property for this (I've looked and if it's there it's not obvious to me).
> Just seeing if I can save myself some time in the future...
>
> --
> Kindest Regards,
>
> Shawn Mason,CCD,MCP
> I.S. Software Design Associates
>
>
|
|
|
 |
Shawn Mason
|
| Posted: 09/03/2002, 6:33 AM |
|
Nope, I mean limiting the amount of text a field shows. e.g. say a string
field is 100 in length and the user has entered 70 characters of
it...instead of showing a huge row (doesn't matter either huge in height or
huge in width) I would like to show only the first 20 characters and then a
"..." to indicate that there is more. I was just asking if CCS has a
property for this.
--
Kindest Regards,
Shawn Mason,CCD,MCP
I.S. Software Design Associates
"RonB" <r.borkent@123chello.456nl> wrote in message
news:al1nko$9ht$1@news.codecharge.com...
> If you mean limiting the amount of records shown in a grid the answer is
> yes. In the properties box, data, there is a records per page section in
> wich you can specify the number of records to be shown. You can set this
to
> any amount you want.
>
> RonB
> "Shawn Mason" <shawn@issda.com> schreef in bericht
>news:al1ac0$irg$1@news.codecharge.com...
> > On a grid I have a couple fields that can grow quite large. I would
like
> to
> > specify that the size of this row only expand to 2 or 3 rows versus
enough
> > to show the entire contents (if the user needs the entire contents they
> can
> > go to the "view" page). So, I know I can change the value
> programmatically
> > in the "Before Show" event, but my question is does CCS have a builtin
> > property for this (I've looked and if it's there it's not obvious to
me).
> > Just seeing if I can save myself some time in the future...
> >
> > --
> > Kindest Regards,
> >
> > Shawn Mason,CCD,MCP
> > I.S. Software Design Associates
> >
> >
>
>
|
|
|
 |
Anderw I
|
| Posted: 09/03/2002, 7:30 AM |
|
Shawn,
I've thought about this before (you just want to show the first few words
from a longer article, like a search engine does).
My solution was to alter the sql of the form changing " SELECT field_name
.... "
to "SELECT LEFT(field_name, 200) ... " [that's in Access, mind you] so that
it only returns the first 200 characters of the field.
A refinement would be to add elipsis (...) at the end of data that had been
truncated, but that would probably slow the query down.
Rgds
Andrew I
Shawn Mason <shawn@issda.com> wrote in message
news:al1ac0$irg$1@news.codecharge.com...
> On a grid I have a couple fields that can grow quite large. I would like
to
> specify that the size of this row only expand to 2 or 3 rows versus enough
> to show the entire contents (if the user needs the entire contents they
can
> go to the "view" page). So, I know I can change the value
programmatically
> in the "Before Show" event, but my question is does CCS have a builtin
> property for this (I've looked and if it's there it's not obvious to me).
> Just seeing if I can save myself some time in the future...
>
> --
> Kindest Regards,
>
> Shawn Mason,CCD,MCP
> I.S. Software Design Associates
>
>
|
|
|
 |
Andrew I
|
| Posted: 09/03/2002, 7:44 AM |
|
.... and further to this, CCS makes it easy to add this expression to the SQL
you don't need to modify the SQL source directly. Just change the label
SourceType (in the label properties) to Database Expression, then enter
Left(field_name, 200) [or equivalent for your database] into the Control
Source property, and that's it.
That's as close as I've found to a CCS feature that helps with this
requirement anyway.
rgds
Andrew
Anderw I <cc@travelinsmgmt.demon.co.uk> wrote in message
news:al2h26$1e3$1@news.codecharge.com...
> Shawn,
>
> I've thought about this before (you just want to show the first few words
> from a longer article, like a search engine does).
>
> My solution was to alter the sql of the form changing " SELECT field_name
> ... "
> to "SELECT LEFT(field_name, 200) ... " [that's in Access, mind you] so
that
> it only returns the first 200 characters of the field.
>
> A refinement would be to add elipsis (...) at the end of data that had
been
> truncated, but that would probably slow the query down.
>
> Rgds
>
> Andrew I
>
>
> Shawn Mason <shawn@issda.com> wrote in message
>news:al1ac0$irg$1@news.codecharge.com...
> > On a grid I have a couple fields that can grow quite large. I would
like
> to
> > specify that the size of this row only expand to 2 or 3 rows versus
enough
> > to show the entire contents (if the user needs the entire contents they
> can
> > go to the "view" page). So, I know I can change the value
> programmatically
> > in the "Before Show" event, but my question is does CCS have a builtin
> > property for this (I've looked and if it's there it's not obvious to
me).
> > Just seeing if I can save myself some time in the future...
> >
> > --
> > Kindest Regards,
> >
> > Shawn Mason,CCD,MCP
> > I.S. Software Design Associates
> >
> >
>
>
|
|
|
 |
michael weaver
|
| Posted: 09/03/2002, 8:24 AM |
|
Shawn,
I don't believe this is a silly question - it's a rather valid one. I'd love
to see it as a built-in Action as I've also had some difficultes getting
this to work in CCS and it's something I really need. I got it working in CC
2.0 by using the following code (PHP) in Before Show:
==============
// Break story field after 50 words, add link to story
$strArray = explode(" ", $fldstory);
$numWords = count($strArray);
if ($numWords < 50)
{
}
else {
if ($numWords > 50)
{
$strArray = array_slice($strArray, 0, 50);
}
$fldstory = implode(" ", $strArray);
$fldstory = $fldstory . "...  <a
href='news_detail.php?id_news=$fldid_news&'>read more </a><br><br>";
}
==============
I tried adapting it for CCS, and well, I just can't get it to work yet.
By the way, thanks to Andrew for the SQL expression solution - it doesn't
work for me in this situation, because I don't want to break a word in half.
BUT, it's a nice pointer for other situations.
If anyone can help with this script, we would appreciate it!
michael
"Shawn Mason" <shawn@issda.com> wrote in message
news:al1ac0$irg$1@news.codecharge.com...
> On a grid I have a couple fields that can grow quite large. I would like
to
> specify that the size of this row only expand to 2 or 3 rows versus enough
> to show the entire contents (if the user needs the entire contents they
can
> go to the "view" page). So, I know I can change the value
programmatically
> in the "Before Show" event, but my question is does CCS have a builtin
> property for this (I've looked and if it's there it's not obvious to me).
> Just seeing if I can save myself some time in the future...
>
> --
> Kindest Regards,
>
> Shawn Mason,CCD,MCP
> I.S. Software Design Associates
>
>
|
|
|
 |
michael weaver
|
| Posted: 09/03/2002, 8:42 AM |
|
Crap. It's pretty easy. Here's what I got to work in PHP:
============================
// Break it after 50 words, add link to story
//
// Grid name: news
// Affected Field Name: story
// notes: Change "50" to whatever # you desire
// variables $test and $short_story should be changed
// to whatever you prefer
//
global $news;
$test = $news->story->GetValue();
$strArray = explode(" ", $test);
$numWords = count($strArray);
if ($numWords < 50)
{
}
else {
if ($numWords > 50)
{
$strArray = array_slice($strArray, 0, 50);
}
$short_story = implode(" ", $strArray);
$short_story = $short_story . "...  <a href='news_detail.php'>read
more <img src='images/more_arrow' border='0' width='8'
height='9'><br><br></a>";
$news->story->SetValue($short_story);
}
============================
The secret is in clicking on the field and adding it to the Before Show of
the FIELD and NOT the grid. That's what worked for me anyway ...
I hope this helps!
m
"michael weaver" <zero@michaelweaver.org> wrote in message
news:al2k71$723$1@news.codecharge.com...
> Shawn,
>
> I don't believe this is a silly question - it's a rather valid one. I'd
love
> to see it as a built-in Action as I've also had some difficultes getting
> this to work in CCS and it's something I really need. I got it working in
CC
> 2.0 by using the following code (PHP) in Before Show:
>
> ==============
>
> // Break story field after 50 words, add link to story
>
> $strArray = explode(" ", $fldstory);
> $numWords = count($strArray);
>
> if ($numWords < 50)
> {
> }
> else {
> if ($numWords > 50)
> {
> $strArray = array_slice($strArray, 0, 50);
> }
> $fldstory = implode(" ", $strArray);
> $fldstory = $fldstory . "...  <a
> href='news_detail.php?id_news=$fldid_news&'>read more </a><br><br>";
> }
>
> ==============
>
> I tried adapting it for CCS, and well, I just can't get it to work yet.
>
> By the way, thanks to Andrew for the SQL expression solution - it doesn't
> work for me in this situation, because I don't want to break a word in
half.
> BUT, it's a nice pointer for other situations.
>
> If anyone can help with this script, we would appreciate it!
>
> michael
>
>
> "Shawn Mason" <shawn@issda.com> wrote in message
>news:al1ac0$irg$1@news.codecharge.com...
> > On a grid I have a couple fields that can grow quite large. I would
like
> to
> > specify that the size of this row only expand to 2 or 3 rows versus
enough
> > to show the entire contents (if the user needs the entire contents they
> can
> > go to the "view" page). So, I know I can change the value
> programmatically
> > in the "Before Show" event, but my question is does CCS have a builtin
> > property for this (I've looked and if it's there it's not obvious to
me).
> > Just seeing if I can save myself some time in the future...
> >
> > --
> > Kindest Regards,
> >
> > Shawn Mason,CCD,MCP
> > I.S. Software Design Associates
> >
> >
>
>
|
|
|
 |
DonB
|
| Posted: 09/03/2002, 11:29 AM |
|
I like this idea. But one suggestion. In the off-chance you get a REALLY
big story, I'd hate to blindly explode it into an array. Might be smart to
pull out 100-200 characters (or whtaever you estimate is "enough") and then
explode that small chunk. Some wise guy dumps a few megs of stuff in there
and you explode THAT- well, could be unpleasant.
Donb
"michael weaver" <zero@michaelweaver.org> wrote in message
news:al2l8a$8uk$1@news.codecharge.com...
> Crap. It's pretty easy. Here's what I got to work in PHP:
>
> ============================
>
> // Break it after 50 words, add link to story
> //
> // Grid name: news
> // Affected Field Name: story
> // notes: Change "50" to whatever # you desire
> // variables $test and $short_story should be changed
> // to whatever you prefer
> //
>
> global $news;
> $test = $news->story->GetValue();
> $strArray = explode(" ", $test);
> $numWords = count($strArray);
> if ($numWords < 50)
> {
> }
> else {
> if ($numWords > 50)
> {
> $strArray = array_slice($strArray, 0, 50);
> }
> $short_story = implode(" ", $strArray);
> $short_story = $short_story . "...  <a
href='news_detail.php'>read
> more <img src='images/more_arrow' border='0' width='8'
> height='9'><br><br></a>";
> $news->story->SetValue($short_story);
> }
>
>
> ============================
>
> The secret is in clicking on the field and adding it to the Before Show of
> the FIELD and NOT the grid. That's what worked for me anyway ...
>
> I hope this helps!
>
> m
>
>
> "michael weaver" <zero@michaelweaver.org> wrote in message
>news:al2k71$723$1@news.codecharge.com...
> > Shawn,
> >
> > I don't believe this is a silly question - it's a rather valid one. I'd
> love
> > to see it as a built-in Action as I've also had some difficultes getting
> > this to work in CCS and it's something I really need. I got it working
in
> CC
> > 2.0 by using the following code (PHP) in Before Show:
> >
> > ==============
> >
> > // Break story field after 50 words, add link to story
> >
> > $strArray = explode(" ", $fldstory);
> > $numWords = count($strArray);
> >
> > if ($numWords < 50)
> > {
> > }
> > else {
> > if ($numWords > 50)
> > {
> > $strArray = array_slice($strArray, 0, 50);
> > }
> > $fldstory = implode(" ", $strArray);
> > $fldstory = $fldstory . "...  <a
> > href='news_detail.php?id_news=$fldid_news&'>read more </a><br><br>";
> > }
> >
> > ==============
> >
> > I tried adapting it for CCS, and well, I just can't get it to work yet.
> >
> > By the way, thanks to Andrew for the SQL expression solution - it
doesn't
> > work for me in this situation, because I don't want to break a word in
> half.
> > BUT, it's a nice pointer for other situations.
> >
> > If anyone can help with this script, we would appreciate it!
> >
> > michael
> >
> >
> > "Shawn Mason" <shawn@issda.com> wrote in message
> >news:al1ac0$irg$1@news.codecharge.com...
> > > On a grid I have a couple fields that can grow quite large. I would
> like
> > to
> > > specify that the size of this row only expand to 2 or 3 rows versus
> enough
> > > to show the entire contents (if the user needs the entire contents
they
> > can
> > > go to the "view" page). So, I know I can change the value
> > programmatically
> > > in the "Before Show" event, but my question is does CCS have a builtin
> > > property for this (I've looked and if it's there it's not obvious to
> me).
> > > Just seeing if I can save myself some time in the future...
> > >
> > > --
> > > Kindest Regards,
> > >
> > > Shawn Mason,CCD,MCP
> > > I.S. Software Design Associates
> > >
> > >
> >
> >
>
>
|
|
|
 |
michael weaver
|
| Posted: 09/03/2002, 1:57 PM |
|
Don - thanks for the suggestion! I guess I did use Andrew's solution after
all!
Thanks again to both of you!
m
"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:al2v2p$q0t$1@news.codecharge.com...
> I like this idea. But one suggestion. In the off-chance you get a REALLY
> big story, I'd hate to blindly explode it into an array. Might be smart
to
> pull out 100-200 characters (or whtaever you estimate is "enough") and
then
> explode that small chunk. Some wise guy dumps a few megs of stuff in
there
> and you explode THAT- well, could be unpleasant.
>
> Donb
>
> "michael weaver" <zero@michaelweaver.org> wrote in message
>news:al2l8a$8uk$1@news.codecharge.com...
> > Crap. It's pretty easy. Here's what I got to work in PHP:
> >
> > ============================
> >
> > // Break it after 50 words, add link to story
> > //
> > // Grid name: news
> > // Affected Field Name: story
> > // notes: Change "50" to whatever # you desire
> > // variables $test and $short_story should be changed
> > // to whatever you prefer
> > //
> >
> > global $news;
> > $test = $news->story->GetValue();
> > $strArray = explode(" ", $test);
> > $numWords = count($strArray);
> > if ($numWords < 50)
> > {
> > }
> > else {
> > if ($numWords > 50)
> > {
> > $strArray = array_slice($strArray, 0, 50);
> > }
> > $short_story = implode(" ", $strArray);
> > $short_story = $short_story . "...  <a
> href='news_detail.php'>read
> > more <img src='images/more_arrow' border='0' width='8'
> > height='9'><br><br></a>";
> > $news->story->SetValue($short_story);
> > }
> >
> >
> > ============================
> >
> > The secret is in clicking on the field and adding it to the Before Show
of
> > the FIELD and NOT the grid. That's what worked for me anyway ...
> >
> > I hope this helps!
> >
> > m
> >
> >
> > "michael weaver" <zero@michaelweaver.org> wrote in message
> >news:al2k71$723$1@news.codecharge.com...
> > > Shawn,
> > >
> > > I don't believe this is a silly question - it's a rather valid one.
I'd
> > love
> > > to see it as a built-in Action as I've also had some difficultes
getting
> > > this to work in CCS and it's something I really need. I got it working
> in
> > CC
> > > 2.0 by using the following code (PHP) in Before Show:
> > >
> > > ==============
> > >
> > > // Break story field after 50 words, add link to story
> > >
> > > $strArray = explode(" ", $fldstory);
> > > $numWords = count($strArray);
> > >
> > > if ($numWords < 50)
> > > {
> > > }
> > > else {
> > > if ($numWords > 50)
> > > {
> > > $strArray = array_slice($strArray, 0, 50);
> > > }
> > > $fldstory = implode(" ", $strArray);
> > > $fldstory = $fldstory . "...  <a
> > > href='news_detail.php?id_news=$fldid_news&'>read more </a><br><br>";
> > > }
> > >
> > > ==============
> > >
> > > I tried adapting it for CCS, and well, I just can't get it to work
yet.
> > >
> > > By the way, thanks to Andrew for the SQL expression solution - it
> doesn't
> > > work for me in this situation, because I don't want to break a word in
> > half.
> > > BUT, it's a nice pointer for other situations.
> > >
> > > If anyone can help with this script, we would appreciate it!
> > >
> > > michael
> > >
> > >
> > > "Shawn Mason" <shawn@issda.com> wrote in message
> > >news:al1ac0$irg$1@news.codecharge.com...
> > > > On a grid I have a couple fields that can grow quite large. I would
> > like
> > > to
> > > > specify that the size of this row only expand to 2 or 3 rows versus
> > enough
> > > > to show the entire contents (if the user needs the entire contents
> they
> > > can
> > > > go to the "view" page). So, I know I can change the value
> > > programmatically
> > > > in the "Before Show" event, but my question is does CCS have a
builtin
> > > > property for this (I've looked and if it's there it's not obvious to
> > me).
> > > > Just seeing if I can save myself some time in the future...
> > > >
> > > > --
> > > > Kindest Regards,
> > > >
> > > > Shawn Mason,CCD,MCP
> > > > I.S. Software Design Associates
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
 |
|