How to hide a column in ABjqGrid by program

Список разделов English forum Desktop components for HTML5 Builder ABjqGrid for HTML5 Builder

Название раздела: ABjqGrid for HTML5 Builder
Описание: Grid component for HTML5 Builder
DBGrid for HTML5 Builder,DBTreeGrid for HTML5 Builder. Master-detail mode,subgrid mode.

Ответить


Введите код в точности так, как вы его видите. Регистр символов не имеет значения.
Код подтверждения
:hi: :smile: :wink: :twisted: :sad: :evil: :smoke: :eh: :eek: :fie: :silenced: :razz: :oops: :help: :spy: :insane: :biggrin: :toothless: :ill: :nervious: :weirdface: :pray: :clap: :think: :boxing: :cyclop: :rambo: :zombie: :cry: Ещё смайлики…
   

Развернуть Обзор темы: How to hide a column in ABjqGrid by program

Download ABjqGrid

Сообщение Nataliya » 22.04.2015, 22:54

I'd like to try ABjqGrid for HTML5 Builder. Can I download a trial version? If can then where?
Help please!

Сообщение wschrabi » 06.03.2015, 19:27

No its a real project to our website. Its easy for you its just to display the MYSQL DB contents in an iframe.
Now it works, thank you very much for your support.
:clap:

Сообщение admin » 06.03.2015, 19:11

OK.
You make a real project or until just learning to work in IDE?

Сообщение wschrabi » 06.03.2015, 19:10

my fault. I did not use the Fieldname but the Caption name.
Now it works fine
thanks
:clap:

Сообщение admin » 06.03.2015, 18:49

Perhaps the script tries to perform a subtraction operation.
Try rename to "GHS_A" in the database and the editor columns (and in programm code).

Сообщение wschrabi » 06.03.2015, 18:25

yes you are complete right! BUt why does the IMAGE not work?
My column name is "GHS-A" as in the table headline.
What is wrong with it?

Сообщение admin » 06.03.2015, 17:52

Check the name of the column.

P.S. For what purpose do you reload the net after hiding the column?

P.S2 Regardless of the state of the checkbox you assign the same value caption. Why? :eek: You can set value in design-time.

P.S3 I think this code would be better.
Код: Выделить всё
    function Button1Click($sender, $params)
    {
//        $this->CheckBox1->Caption = "Verstecke GHS Icons in Tab.";  // You can set value in design-time

        $lang=get_languages('data');
        $lang=$lang[0][1];


        $a=$this->ABjqGrid1->Columns;
        $columns['de'][11]['Hidden']=$columns['de'][12]['Hidden']=$columns['de'][13]['Hidden']=$columns['de'][14]['Hidden']=$this->CheckBox1->Checked;
        $c=$columns[$lang];
   
        foreach($c as $key=>$value)   $a[$key]['Hidden']=$c[$key]['Hidden'];

        // set columns
        $this->ABjqGrid1->Columns=$a;

}

Сообщение wschrabi » 06.03.2015, 00:54

THANK A LOT!!!! :clap:

Добавлено спустя 2 часа 31 минуту:
Admin,
I tried
Код: Выделить всё
    function CheckBox1JSClick($sender, $params)
    {
        ?>
        //begin js

        if (document.getElementById('CheckBox1').checked)
        {

            $ABjqGrid1.jqGrid("hideCol","RecID").trigger("reloadGrid"); // works fine
            $ABjqGrid1.jqGrid("hideCol","GHS-A").trigger("reloadGrid"); // does not work , column is an IMAGE!


        } else
        {
            $ABjqGrid1.jqGrid("showCol","RecID").trigger("reloadGrid"); // works fine
            $ABjqGrid1.jqGrid("showCol","GHS-A").trigger("reloadGrid"); // does not work , column is an IMAGE!
        }

        //end
        <?php
    }

The IMAGE Column does not hide. ON Startup I show the image and I can not hide with javascript. :help:
When I make a php routine it work also on the Image column.

Код: Выделить всё
    function Button1Click($sender, $params)
    {
        if ($this->CheckBox1->Checked)
        {
        $this->CheckBox1->Caption = "Verstecke GHS Icons in Tab.";

        $lang=get_languages('data');
        $lang=$lang[0][1];

        // get columns
        $a=$this->ABjqGrid1->Columns;
        $columns['de'][11]['Hidden']=true;
        $columns['de'][12]['Hidden']=true;
        $columns['de'][13]['Hidden']=true;
        $columns['de'][14]['Hidden']=true;
        $c=$columns[$lang];
        foreach($c as $key=>$value)   $a[$key]['Hidden']=$c[$key]['Hidden'];
        // set columns
        $this->ABjqGrid1->Columns=$a;
        }
    else
        {
        $this->CheckBox1->Caption = "Verstecke GHS Icons in Tab.";

        $lang=get_languages('data');
        $lang=$lang[0][1];

        // get columns
        $a=$this->ABjqGrid1->Columns;
        $columns['de'][11]['Hidden']=false;
        $columns['de'][12]['Hidden']=false;
        $columns['de'][13]['Hidden']=false;
        $columns['de'][14]['Hidden']=false;
        $c=$columns[$lang];
        foreach($c as $key=>$value)   $a[$key]['Hidden']=$c[$key]['Hidden'];
        // set columns
        $this->ABjqGrid1->Columns=$a;
        }
}

Сообщение admin » 06.03.2015, 00:10

Please see here http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods
Example for JS
Hide
$ABjqGrid1.jqGrid('hideCol',["id","CustName"]);

Show
$ABjqGrid1.jqGrid('showCol',["id","CustName"]);

Сообщение wschrabi » 05.03.2015, 16:37

thanks a lot, now it works.

Сообщение admin » 05.03.2015, 16:22

Hello!

The first index of the array must be a number. (The column number in the editor columns. It starts with 0)

How to hide a column in ABjqGrid by program

Сообщение wschrabi » 05.03.2015, 15:51

HI,
How can I set the Property Hidden to TRUE for a Column named GHS-A in ABjqGrid by PHP automatically?
this does not work:
Код: Выделить всё
$this->ABjqGrid1->Columns['GHS-A']['Hidden']=false;
thanks
walter
cron