Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
580
Not Getting Columns Count in JAVA Script
posted

Hi,

I am new to Infragistics & WebHierarchicalDataGrid. I am trying to get the binding columns count of grid control thru JAVA script. I have written following code,

 

<script type="text/javascript" id="igClientScript">

   function GetColumns() {

           var Grid = $find('WebHierarchicalDataGrid1');

           alert(Grid);

           var row = Grid.get_columns();

           alert(row);

        }

</script>

I am getting following error at line#3 in GetColumns (Grid.get_columns()) function of JS.

JavaScript runtime error: Object doesn't support property or method 'get_columns'

 

Do I need to explicitly add any additional JS file?

Can any one help me, how do I use all JS functions of WebHierarchicalDataGrid?

 

Thanks,

Yogesh

  • 20255
    Verified Answer
    Offline posted

    Hello,

    I'm just following up to see if you need any further assistance with this issue. If so please do not hesitate to contact me.

  • 20255
    Verified Answer
    Offline posted

    Hello,

    Thank you for using our product!

    In order to get the columns count you need to use get_length() function.

    For example:

    ig_controls.WebHierarchicalDataGrid1.get_gridView().get_columns().get_length();

    In your case will be:

    Grid.get_gridView().get_columns().get_length();

    If you want to get it with jQuery you can do this like that:

    $find("WebHierarchicalDataGrid1").get_gridView().get_columns().get_length();

    If you have any further questions regarding this matter please contact me!