CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 how expand news_details when clicke news_title

Print topic Send  topic

Author Message
m5alsalahy

Posts: 14
Posted: 03/10/2009, 1:02 AM

hi every one
i have 20 news (from Data Base),, so i want when i click the news_title the news_details expand under news_title....

i hope my question is clear...
View profile  Send private message
datadoit
Posted: 03/10/2009, 3:25 PM

JR, this would be awesome if it could work with an editable grid. Ex:
click on an 'edit' link in an editable grid row, and it expands to allow
editing.
jjrjr1


Posts: 942
Posted: 03/10/2009, 3:39 PM

Hi

Here is a CCS module that will do just that. It incudes a CCS page that will take 2 fields (This module creates collapsable/expandable FAQs for a CCS grid) text and body and display the text as a link when clicked the body expands and the other bodies all collapse.

With very easy and minor mods you could use it for your news titles / stories.

I have used this in many projects and it works great.

There is documentation to explain how you might do that.

http://ccselite.com/online_store.php?pid=26

Have fun
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
Gena

Posts: 591
Posted: 03/10/2009, 4:54 PM

Quote datadoit:
JR, this would be awesome if it could work with an editable grid. Ex:
click on an 'edit' link in an editable grid row, and it expands to allow
editing.
I have already done this, editable grid + some JS... ;-)
;-)
_________________
Gena
View profile  Send private message
Oper


Posts: 1195
Posted: 03/10/2009, 6:15 PM

Quote m5alsalahy:
hi every one
i have 20 news (from Data Base),, so i want when i click the news_title the news_details expand under news_title....

i hope my question is clear...

also you could use some simple Java Script to change teh Syle withoutn needing to use Jquery or somthing

like:
OBJ.style.display == 'none';


Also Datadoit how you manage to locate your post before the last one. (maybe you havnet noticed)
Like replying to a future question. :)
newgroup?

_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
Oper


Posts: 1195
Posted: 03/10/2009, 9:45 PM

Small Sample
http://www.CCSTalk.com/CCSDemo/Collapse

if you want the CCS Source let me know but is for ASP
you will have to modify a BIT
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
jjrjr1


Posts: 942
Posted: 03/10/2009, 11:59 PM

@datadoit

This is a CCS project page and would not be difficult for someone to modify this to be an editable grid instead of a grid record combination as it delivered right now.

Currently in this CCP file for building the collapsable grid data table, The record select grid is a collapsable grid which, when clicked, takes you to the edit record where you add the link text and the drop down text. The table is updated with the link text, the dropdown text, and the javascript / html text for use in a dropdown grid. Basically creating collapable content automatically for you.

The resultant table can be used also in a non editable display grid of collapable link/text on any CCS page as well.

SInce this is a CCS projecyt page, the record update page could be modified to be an editable grid instead of a grid / record combination.

This is not meerly just some javascript to add to your ccs page and some event functions to add, It is a stand alone collapsable grid generator and display system for CCS. No event functions to add to yoru CCS pages. Just a few line of HTML added to a project page.

http://ccselite.com/online_store.php?pid=26
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
jjrjr1


Posts: 942
Posted: 03/11/2009, 1:26 AM

I started to look at what it would take to add editable grids to this and while doing so, wondered why. I am not sure how that would look. This is not just an implementation of drop down areas of an input or diaplay screen.

It seems that there is some confusion as to what this drop in module does.

It is actually a content generator that will create collapsable data table entries useable in a CCS display grid. Example is a FAQ system or a News / Article system with collapable/expandable link / display, as the originator of this post was looking for I think,

It does not require addition of any code in your PHP script. It is a CCP file so can be converted to other languages that CCS supports besides PHP with minor mods to custom code to suit the new CCS language.

If there is a need for this in an editable grid, let me know how that would work. You Just want it as an editing interface? Let me know. Or maybe gena would share how that was done or you could use opers solution.

Those are different things than what this module does.

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
GaryDN

Posts: 34
Posted: 03/11/2009, 5:29 AM

Quote Oper:
Small Sample
http://www.CCSTalk.com/CCSDemo/Collapse

if you want the CCS Source let me know but is for ASP
you will have to modify a BIT
Can I get a copy of this code? I use asp and would like to play with this some.

thanks
I'll pm u my email
View profile  Send private message
Oper


Posts: 1195
Posted: 03/11/2009, 4:11 PM

There is a Folder that Containt the SQL to generate the Database and Table Sample
also the Project is simpel and use a demo user and password. change according.


http://www.informatica.com.do/download.asp?cid=61


(if you got download problem let me know)
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
damian

Posts: 838
Posted: 03/11/2009, 5:58 PM

I spent all night on this (im a bit slow!) but i got it working... here is my solution -

i used some stuff from here: http://javascript.internet.com/ajax/ajax-loader.html
and here: http://www.webmasterworld.com/javascript/3152822.htm

this will let you click on link to see whole article and click on link again to hide full article

ok... created a file called ajaxLoader.js

contains the following text:

function ajaxLoader(url,id) {  
  
var myElement = document.getElementById(id);  
if(myElement.style.display == 'block') myElement.style.display = 'none';  else myElement.style.display = 'block';  
  
  
  if (document.getElementById)  {   
  
    var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();  
  }  
  if (x) {  
    x.onreadystatechange = function() {  
      if (x.readyState == 4 && x.status == 200) {  
        el = document.getElementById(id);  
        el.innerHTML = x.responseText;  
      }  
    }  
    x.open("GET", url, true);  
    x.send(null);  
  }  
}

may be some redundant stuff in there (its a bit beyond me!)

then i create my news_brief page with all my short news article listings.

i add the following line to the HEAD of my page:

<script language="JavaScript" src="ajaxLoader.js" type="text/javascript" charset="utf-8"></script>

i also create a page containing only a grid (not an include page as i first thought) with minimal styling - this is going to include the whole news article and any other bits eg: data, source, link etc the source will use where news_id= from URL

back in my news_brief page i create a link manually at the end of the brief news:

<a onclick="ajaxLoader('news_full.php?news_id={news_id}','news.{news_id}')">...read more</a>   
<div id="art.{news_id}"></div>

some things to note (save you some time nutting thru them):
ajaxLoader() takes 2 parameters - first is the page to load, second is the div layer to load it in
in my example my div layer is called news.{news_id} this creates a div called news.56 or news.57 etc creating a unique target div for each news article to appear in.
need to make sure that {news_id} is referenceable too

news article will appear directly below and will inherit current page formatting if you dont put formatting in the news_full page

hope this works for someone else. hope i coverred everything.

one thing that still need work is because link is javascript mouse doesnt change to pointer... anyone know how to change that?

regards
damian

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
m5alsalahy

Posts: 14
Posted: 03/14/2009, 12:31 PM

thanks to every one to help me....
mr :datadoit ,Gena ........i try to do editable grid + some JS ..i am sorry not working maybe i dont understand...
mr :jjrjr1 i am thinking about CCSFAQs Ver 1.0..
mr :Oper i can't download the Folder please give other link..
mr : damian i try your solution and i get this error
ajaxLoader.js Line: 4
Error: myElement is null
View profile  Send private message
jjrjr1


Posts: 942
Posted: 03/14/2009, 12:44 PM

Hi m5alsalahy

I think CCSFaqs ver 1.0 will do exactly what you are looking for.

Simple to install and simple to use as well.

Let me know



_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
Oper


Posts: 1195
Posted: 03/14/2009, 2:47 PM

Quote m5alsalahy:
thanks to every one to help me....
mr :datadoit ,Gena ........i try to do editable grid + some JS ..i am sorry not working maybe i dont understand...
mr :jjrjr1 i am thinking about CCSFAQs Ver 1.0..
mr :Oper i can't download the Folder please give other link..
mr : damian i try your solution and i get this error
ajaxLoader.js Line: 4
Error: myElement is null

http://www.informatica.com.do/download.asp?cid=61
m5 if you are using firefox you need to press CTRL + (click con el mouse)
(you dont need extra JS or anything)
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
damian

Posts: 838
Posted: 03/14/2009, 4:06 PM

please post link to your page so i can have a peek...
_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
Gena

Posts: 591
Posted: 03/14/2009, 4:48 PM

So I will explain how I do this using jQuery.

Add jquery in your HTML file at the begining + add too functions like this:

  
<html>  
<head>  
<meta http-equiv="content-type" content="text/html; charset=windows-1251">  
<title>title</title>  
<meta content="MediaPro" name="GENERATOR">  
  
<script src="lib/jquery.js" type="text/javascript"></script>  
  
<script type="text/javascript">  
$(document).ready(function()  
{  
  //hide the all of the element with class msg_body  
  $(".msg_body").hide();  
  
  //toggle the componenet with class msg_body  
  $(".msg_head").click(function()  
  {  
    $(this).next(".msg_body").slideToggle(600);  
  });  
});  
  
//this can be used to change color when you hover you header line  
$(document).ready(function(){  
      
    $(".msg_head").hover(  
      function () {  
  	$(this).css({ cursor:"pointer", backgroundColor:"yellow" });  
      },   
      function () {  
  	$(this).css({ cursor:"", backgroundColor:"" });  
      }  
    );  
  
  });  
</script>  
..... the rest of your html page  

After that go to your Grid and add 2 divs - one for your news_title line and second for your news_details like this:

  
<div class="msg_head">  
 news_title whatever else  
</div>  
  
<div class="msg_body">  
news_details  
news_details  
news_details  
 </div>  

that's all!

note that you can't put DIV inside table stucture to show/hide row(s) or cell(s) so this code wont work:

WRONG:
<table>  
<div class="msg_body">  
 <tr>  
    <td>aaa </td>  
    <td>bbb </td>  
</tr>  
 </div>  
</table>  

so you can't "break" the Table.

But you can put it over full table and it will work:

GOOD:
<div class="msg_body">  
<table>  
 <tr>  
    <td>aaa </td>  
    <td>bbb </td>  
</tr>  
</table>  
</div>  

_________________
Gena
View profile  Send private message
Oper


Posts: 1195
Posted: 03/14/2009, 5:26 PM

Quote damian:
please post link to your page so i can have a peek...

sure sir here:

http://www.ccstalk.com/ccsdemo/collapse/
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
damian

Posts: 838
Posted: 03/14/2009, 8:30 PM

sorry Oper i meant m5alsalahy...
i did already have a look at your demo and it works well
an interesting choice of bands too :)
_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
damian

Posts: 838
Posted: 03/15/2009, 4:11 AM

gena - i like your method - it was very easy to implement
oper - havent tried yours yet

an advantage both of your methods have is that the data is all pre-loaded which is good for seo - all your content is there on the same page
conversely the method i used is going to load pages faster - particularly if the div/hidden content contains images - and if there are lots of articles/items - but not so good for seo because all the extra content is grabbed only when the link is clicked

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
jjrjr1


Posts: 942
Posted: 03/15/2009, 7:13 AM

Hi

@oper

That is very nice. and looks really cool. Your solution is what the originator of this post was looking for.

Your example also gave me another use idea for CCSFaqs Ver 1.). That would be a menu system where the text could be the link to a page and the image, in your case an arrow, to display text desribing the link. CCSFaqs could implement that content easily and it would be CCS Language Independent.

However, It requires custom code to be put into each page and your example is an ASP only solution.. Which is fine, easy for most to modify.

CCSFaq Ver 1.0 creates language independent code for use as drop downs. In other words the table with the data to be displayed can be used on any language CCS page without the addition of any functions to add to the CCS Scripts.. Basically you only need to create your dropdown data and it will be usable even in a perl CCS page without having to convert any before show row events custom code. All you do is add the grid. The table can also be used as a standard grid.

Also CCSFaqs Ver 1.0 is ready to work as delivered. There is no coding required at all to generate Drop Down, Expandable/Collapsable Content.

It is a content generator written in PHP but again, with minor mods can run in any CCS language. Additionally the CCSFaqs can also be easily changed so the question link display can contain images, or in any format you want to display, as you used a arrow for the link, and still maintain language independence.

Incidentally, CCSFaqs Ver. 1.0 is also CCS Database Connection indendent for custom DB Queries. In other words you do not have to know the DB Class name to create a database object for custom queries. As delivered, it can be dropped into any PHP project and it will dynamically determine the database connection parameters for certain functions. So the function new cslDBConnectionname() is not required to know the connection name class for the project you dropped it in to.

All solutions are usually good. It just depends on your requirements.

http://ccselite.com/online_store.php?pid=26

BTW: Aren't you worried that http://ccstalk.com runs the risk of diluting this forum a bit?

Just wondering, alot of folks here worry about that...

I do wish you luck with that site..





_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
damian

Posts: 838
Posted: 03/15/2009, 8:08 AM

hi john, your tool/example is also good. i do note what might be a bug in that if you click link once it expands additional content, twice it removes additional content, third or more times (until you click something else) nothing occurs...
does the tool add the javscript also?

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
jjrjr1


Posts: 942
Posted: 03/15/2009, 8:16 AM

Hi Damian

The tool does not add the javascript. Since I have not taken the time to figure out the CCS XML for generating HTML as the Builders do, You have two small blocks of HTML to place before and after each grid you create. And you add a Javascript function into the custom code white space in the HTML.

This is sort of like how you must add Artisteer style to a CCS page.

The tool however does create language indepenant HTML automatically for the Grid's content.

Also, as I thought about Opers demo, the tool could also make a menu system with a link and a dropdown to describe that link easily, also language independent.

It is delivered with documentation as how to use the tool.




_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
Oper


Posts: 1195
Posted: 03/15/2009, 9:13 AM

Quote :
Your example also gave me another use idea for CCSFaqs Ver 1.). That would be a menu system where the text could be the link to a page and the image, in your case an arrow, to display text desribing the link. CCSFaqs could implement that content easily and it would be CCS Language Independent.

we do something similar with Image Link for Gold's Gym Franchise and Exercise Routine

Quote :
BTW: Aren't you worried that http://ccstalk.com runs the risk of diluting this forum a bit?

Explain did not undertand.


_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
jjrjr1


Posts: 942
Posted: 03/15/2009, 9:20 AM

Damian

Thanks for pointing that out. Fixed that problem

http://ccselite.com/online_store.php?pid=26

BTW: The javascript you add the the HTML is only 7 lines.


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
m5alsalahy

Posts: 14
Posted: 03/15/2009, 10:17 AM

Quote Oper:
m5 if you are using firefox you need to press CTRL + (click con el mouse)
thanks i get it............

Quote damian:
please post link to your page so i can have a peek...
the page and error ...
http://www.filefactory.com/file/af54a1a/n/news_rar
i am using php and mysql

Quote Gena :
<script src="lib/jquery.js" type="text/javascript"></script> 
i don't have file jquery.js form where i get src= lib/ jquery.js........i am sorry i am beginner in CCS.......

View profile  Send private message
Gena

Posts: 591
Posted: 03/15/2009, 11:16 AM

download latest version here jquery.com
_________________
Gena
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.