GetHiddenValue may return null

Posted by: bjwood98 on 15 September 2017, 3:26 am EST

    • Post Options:
    • Link

    Posted 15 September 2017, 3:26 am EST

    I have a page the uses one FpSpread control that is repopulated from multiple datasets depending on what the user wants to view. The last column in the table contains the identifier of the row. The column label is always ‘ID’. I use GetHiddenColumn on the client side to read the row identifier to decide what to do.

    var vID = tblCtl.GetHiddenValue(theRow, ‘ID’);

    This works fine until I populate the FpSpread control with a dataset with a different number of columns.

    I tracked the issue down to the follow function (initHiddenColumns) in the multicolumncombobox.js file:

    FpSpreadJS.prototype.initHiddenColumns = function (e) {

    for (var b = , d = 0, c = e.attributes.length - 1; c >= 0; c–) {

    var a = e.attributes[c];

    if (a.name.length > 2 && a.name.charAt(0).toUpperCase() == “C” && a.name.charAt(1) == "") {

    //add the following logic to eliminate columns that do not belong

    var theCol = parseInt(a.name.replace('c
    ’, ‘’));

    if (theCol <= e.ColCount) {

    b[a.name] = a.value; d++

    }

    }

    }

    b.count_of_hidden_cols = d;

    return b

    };

    I modified the function to eliminate any columns that exceed the column count of the table.

    Please add this to your list of bugs so it can be fixed.

    I am using version 10.4.20172.0

  • Posted 15 September 2017, 3:26 am EST

    Hello,

    I am not able to replicate this issue at my end. I have attached a sample application for you to test, in case you find any discrepancies please modify the same send it back to me.

    Here are the steps I followed:

    1. Loaded a data set in Spread with a table with 3 columns.
    2. Column 3 is ID column and hidden in Spread.
    3. I get the hidden value at client side it gives the correct Id for the Row index passed.
    4. I change the dataset with a table with 4 columns.
    5. Column 4 is ID column and hidden .

      6 I again get the hidden value using GetHiddenValue method client side and it gives me correct ID.

    Thanks,

    Deepak Sharma

    2017/07/SpreadWebHiddenColumn.zip

  • Posted 15 September 2017, 3:26 am EST

    Deepak,

    Thanks for getting back to me so quickly. Can you do the following?

    1. Please make sure that the FpSpread control is in an update panel
    2. Load the 3 column dataset and test
    3. Load the 4 column dataset and test
    4. Load the 3 column dataset and test

    The problem is when you load a dataset with fewer columns. If you step thru your javascript function named initHiddenColumns you will see that when the shorter dataset is loaded, the hidden column from the longer dataset will be in the hiddenColumns array.

    Thank you,

    Brian

  • Posted 15 September 2017, 3:26 am EST

    Hello,

    You would need to set the visibility of all columns to true or resets the datasoruce before assigning the new datasource.

    Thanks,

    Deepak Sharma

  • Posted 15 September 2017, 3:26 am EST

    That does not work.

    1. I have EnableViewState set to false on the spread control
    2. On the postback, the spread control has the default number of rows and columns (3 and 4)
    3. I have tried setting all columns to visible, and resetting the datasource and unless I do a needless roundtrip to the client, the bad client data persists.

    Please try your tests using dataset with more than 10 columns and you can easily reproduce the error. This is a bug that needs to be fixed. It did not exist in earlier versions.

  • Posted 15 September 2017, 3:26 am EST

    Hello,

    I am able to replicate this issue when using UpdatePanel.

    I have submitted it as a bug to the development team. I will let you know once I get an update on this.

    Tracking id for this issue is :241093

    Thanks,

    Deepak Sharma

  • Posted 15 September 2017, 3:26 am EST

    Hello,

    This is found to be a bug with Spread and our development team is working to get this fixed in our future release of Spread. However to workaround this issue you can save the column count of sheet before changing and compare it when DataModelChanged event to remove redundant data.

    Please refer to the attached sample page.

    Thanks,

    Deepak Sharma

    2017/08/WebForm1.aspx_.cs_.zip

  • Posted 12 December 2017, 9:01 pm EST

    Hello,

    This issue has been fixed with our latest version release of Spread .NET v11.0. You can download the same from our website.

    Thanks,

    Deepak Sharma

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels