Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with values using aspx edit inline #34

Open
fgiacomelli opened this issue Feb 9, 2016 · 2 comments
Open

Problem with values using aspx edit inline #34

fgiacomelli opened this issue Feb 9, 2016 · 2 comments

Comments

@fgiacomelli
Copy link

Hello,
I'm using this library in my aspx project.
I have this problem: on a row of my table I'm using edit inline, and seems that calling the stackable function at the end of my page, in this way:

<script> $(window).load(function () { $('#<%=GridViewList.ClientID%>').stacktable({ myClass: '.stacktable' }); }); </script>

the value that is inside the textbox I'm editing is replaced by the stackable js attaching the new value instead of replacing it. I mean that if I have a textbox with value 50, and I edit it with a new value, i.e. 55, the new value submitted to the server is 50,55 instead of 55.

I already tried to use the cardtable and stackcolumns functions instead of stackable() but it doesn't help. Can you suggest me how to solve it? Thank you

@fordbe
Copy link

fordbe commented Apr 6, 2016

Same problem here. To replicate, add an asp textbox and asp button control inside a table with the responsive-table class. It appears on postback that stackable.js is interfering with View State by writing the previous value, appending a comma, and adding the new value.

@timmer3
Copy link

timmer3 commented May 7, 2017

i have exactly the same problem, concisely reported above by fordbe.
in summary ANY asp.net application basically cannot use stacktables because it modifies the HTML input values by converting them into an array in the form BEFORE_VALUE,AFTER_VALUE.
it has taken hours to figure out that stacktables is the cause of this unusual behaviour. i can't see anything in stacktables.js that is directly causing this to happen, but my guess is that it relates to HTML manipulation of the table and inputs. in my testing i am using desktop resolution and not triggering the collapsed table view for phones etc.

for now i am using this clunk server side fix on all INPUT / textboxes:

private string FixStacktablesInputValues(string val)
{
    // strange behaviour caused by StackTables where all the HTML inputs have an array of values, in the form OLD,NEW and if there is no change then NEW is blank. 
    return val.Trim(',').Split(',').Last();     // always return the 'last' element in the array, where there is no change then trim off of the comma to make the original value the one that is preserved
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants