This is a migrated thread and some comments may be shown as answers.

How to resize Popup Editor

5 Answers 735 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rooney
Top achievements
Rank 1
rooney asked on 11 Oct 2012, 04:37 AM
Hi,

Anyone know how to resizing window of popup editor?
like resizing width and height.

5 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 11 Oct 2012, 09:38 AM
Hello Rooney,

Resizing the popup window in Kendo UI Grid is not supported out of the box and in order to achieve the desired outcome an additional code is needed. For example you can use the following CSS: 
.k-widget.k-window {
    width: 500px;
    height: 500px;
}

I hope this information helps. 

Kind regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
rooney
Top achievements
Rank 1
answered on 11 Oct 2012, 10:09 AM
Hello Iliana Nikolova

Thank for you info
0
Nohinn
Top achievements
Rank 1
answered on 11 Oct 2012, 11:05 AM
Be careful if you have other window controls in your site, as this css rule will also be applied to them.
If you only want to apply it to the edit popup window, you can use this code in the edit event of the grid:
edit: function(e) {
   $(e.container).parent().css({
      width: '500px',
      height: '500px'
   });
}
0
rooney
Top achievements
Rank 1
answered on 11 Oct 2012, 02:44 PM
Hii nohinn
thank before

i have been following your post, in this http://www.kendoui.com/forums/ui/grid/crud-actions---what-should-server-response-be.aspx#2256031
i have some problem, when i creating new data and finish it, and than that new data is updated, that data is not update but adding new data. updating process can be working if page is reloaded.
i using code igniter to make it

this kendo script :
$("#grid_bank").kendoGrid({
        dataSource: {
            transport: {
                read: "<?=base_url()?>/bank",
                create: {url:"<?=base_url()?>/bank/create",type:"POST"},
                update: {url:"<?=base_url()?>/bank/update", type:"POST"},
                destroy: {url:"<?=base_url()?>/bank/destroy",type:"POST"}
            },
            batch: true,
            schema: {
                model: {
                    id: "id_bank",
                    fields: {
                        id_bank: {type: "number" },
                        nama_bank: { type: "string" },
                    }
                }
            }, pageSize: 25
        },
        editable:  "popup", height: 450, filterable: true, sortable: true, pageable: true,
        toolbar: [{text: "Tambah Data", name: "create"}],
        columns: [
            { field: "nama_bank",title: "Nama", filterable: true },
            { command: [{text:"Edit", name:"edit"}, {text:"Hapus",name:"destroy"}], title: " ", width: "160px" }
        ]
    });
and this controller script :
....
public function index() {
        header("Content-type: application/json");
        $arr = array();
        $data=$this->bank_model->get_bank();
        foreach ($data as $hasil) {
            $arr[]=$hasil;
        }
         
        print json_encode($arr);
    }
     
    public function create() {
        header("Content-type: application/json");
        $nama_bank = $_POST['models'][0]['nama_bank'];
        $this->bank_model->create_bank($arr);
    }
     
    public function update() {
        $id_bank = $_POST['models'][0]['id_bank'];
        $nama_bank = $_POST['models'][0]['nama_bank'];
        $arr = array( 'nama_bank' => $nama_bank );
        $this->bank_model->update_bank($id_bank, $arr);
    }
     
    public function destroy() {
        $id_bank = $_POST['models'][0]['id_bank'];
        $this->bank_model->destroy_bank($id_bank);
    }
and this model script :
public function get_bank()
    {
        $this->db->select('*');
        $this->db->from('bank');
        $this->db->order_by('id_bank','DESC');
        $query = $this->db->get();
  
        return $query->result();
    }
     
    public function create_bank($data){
        $this->db->insert('bank', $data);
    }
     
    public function update_bank($id, $data){
        $this->db->where('id_bank', $id);
        $this->db->update('bank', $data);
    }
     
    public function destroy_bank($id){
        $this->db->where('id_bank', $id);
        $this->db->delete('bank');
    }

so, why can't updating data after adding new data before page is reloaded.

Thank
0
Nohinn
Top achievements
Rank 1
answered on 11 Oct 2012, 03:41 PM
I'm sorry, I have never worked with popup edit mode before, so I'm not sure if anything from the code I posted should be adapted to it.
I can just say that be careful using a number as the Id field of the grid, as the grid will treat 0 as a new record although it already exists.
Tags
Grid
Asked by
rooney
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
rooney
Top achievements
Rank 1
Nohinn
Top achievements
Rank 1
Share this question
or