2

I am trying to save all the data in a slickgrid at once rather than one at a time, my plan was to use Saving changes in SlickGrid so my code is :

<script language='javascript' type="text/javascript">
    function saveQuote() {

    $("input[name='mydata']").val(jQuery.parseJSON(grid.getData()));
  }
</script>

with my data being a textbox ... (so I can debug and see what is happening) My Grid is empty to begin with and the user adding data(which has calculations etc) however when I press my save button and call my saveQuote no data is being presented, any one know why?

Community
  • 1
  • 1
chris
  • 551
  • 1
  • 13
  • 32

1 Answers1

1

the problem was with:

   $("input[name='mydata']").val(jQuery.parseJSON(grid.getData()));

so I replaced it with

$("input[name='mydata']").val(JSON.stringify(grid.getData()));

full code is now:

<script language='javascript' type="text/javascript">
   function saveQuote() {
    $(function() {
        $("input[name='mydata']").val(JSON.stringify(grid.getData()));
            });
}

chris
  • 551
  • 1
  • 13
  • 32