Author Topic: Can not set hscroll and vscroll length programatically  (Read 7788 times)

parthcool07

  • Newbie
  • *
  • Posts: 3
    • View Profile
Can not set hscroll and vscroll length programatically
« on: September 26, 2013, 11:27:35 am »
Hello,

I am trying to set hscroll and vscroll height and width programatically on grid resize.
But I can not set length of hscroll and vscroll.

looking for your reply.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Can not set hscroll and vscroll length programatically
« Reply #1 on: September 26, 2013, 10:47:49 pm »
How are you doing it. Would you mind sharing your code.

parthcool07

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Can not set hscroll and vscroll length programatically
« Reply #2 on: September 27, 2013, 10:39:11 am »
Yes sure, on resize event of pqGrid fn._refreshResizable , i am trying to set length of scroll bar as below code.

var tblID = $(this).attr('id');
$("#"+tblID).find(".pq-hscroll").css("width",that.element.width());

The Problem is when i have created a grid at that time scroll bar is working fine, but now if i am doing resize then it will not change length of scrollbar (horizontal and vertical) depending on width and height of grid. So I am trying to reassign height and width to vertical and horizontal scroll bar. But it is taking original length value at the time of grid created.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Can not set hscroll and vscroll length programatically
« Reply #3 on: September 30, 2013, 07:58:41 pm »
The problem you have mentioned should go away if you use refresh after grid resize.

Anyhow if you still need to set length of scrollbar

use length http://paramquery.com/api/scrollbar#option-length

to set the length of scrollbar instead of css
« Last Edit: September 30, 2013, 08:02:08 pm by paramquery »

parthcool07

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Can not set hscroll and vscroll length programatically
« Reply #4 on: October 01, 2013, 10:46:47 am »
hello,

I have try to set as you say, but it is not updating length of horizontal and vertical scrollbar on grid resize event.

that.options.height = that.element.height();
that.options.width = that.element.width();
that.$hscroll.pqScrollBar({
     direction: "horizontal",
      pace:that.options.scrollModel.pace,
      cur_pos: 0,
   length:that.options.width}).pqScrollBar('refresh');

Can you please help me to solve this problem.

On resize grid view is not taking scrollbar length automatically.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Can not set hscroll and vscroll length programatically
« Reply #5 on: October 01, 2013, 05:32:08 pm »
I believe you don't need to change it's length as it's taken care of grid by itself.

Just follow this example.

http://paramquery.com/demos/resizable_popup

and please let know if you face any problem with it.
« Last Edit: October 01, 2013, 07:13:01 pm by paramquery »