发新话题
打印

ListView acting like DBGrid

ListView acting like DBGrid

The application we're developing has the UI layer abstracted from the DB layer, so connecting directly to the DB via a DBGrid is out of the question. So I'm looking to use a ListView instead.

I'm trying to make it so when you click a row in the ListView, data in a memo field is changed, rather like the VCL DBGrid examples out there. I can get the ListView to populate at runtime, but it doesn't have the extra properties that DBGrid has like onClick. When I use JSonSelectedChange for the ListView, it doesn't display properly (even if the function is blank). Instead of displaying nicely within the PageControl, it's far to the left and only the "select columns" icon is visible.

Does anyone have any suggestions of what I can do to either 1) get the ListView to display correctly with a JSOnSelectionChange or 2) Use a DBGrid with our chosen database class instead of the database/datasource/table setup.

Thanks.
p.s. I'm assuming #2 is out of the question, but I thought I'd ask anyway.

TOP

So here's a little more data to help show the JSOnChangeSelection problem. I've got the following code, and the columns set with the column editor:
复制内容到剪贴板
代码:
class Unit4 extends Page
        {
               public $ListView1 = null;
               function ListView1BeforeShow($sender, $params)
               {
                $data=array("1", "2", "3", "4", "5");
                $data2=array("asd", "fd", "3", "wer", "m");
                $data3=array("a", "b", "c", "d", "e");
                $this->ListView1->addItem("name", $data);
                $this->ListView1->addItem("asfsadf", $data2);
                $this->ListView1->addItem("tef", $data3);
               }
               function ListView1JSSelectionChanged($sender, $params)
               {
               ?>
               //Add your javascript code here        
               <?php
               }
        }
And when i try to run it, it's completely blank. Take away the ListView1JSSelectionChanged and it works. According to the javascript error console in Firefox and IE6, it tells me that ListView1JSSelectionChanged is not defined... so it looks like this is a javascript error after all. I admit, my javascript skills are rather abysmal. Can anyone point me in the right direction to get the program to recognize this function?
一個偽裝成白癡的天纔!

TOP

Has anyone managed to get the OnSelectionChanged working for the ListView component?
一個偽裝成白癡的天纔!

TOP

http://www.72e.net/?cid=wawa 看看, 可能有你们所需的!!
★ 域名主机  http://www.72e.net/?cid=wawa  服务器租用($6999),托管($4000 )并送非法信息过滤系统,EDNS智能解析系统等

TOP

发新话题