Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. Edit Amount
  2. 212000.00
  3. {
  4. "message": "",
  5. "exception": "Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException",
  6. "file": "C:\xampp\htdocs\DS_dev_01\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php",
  7. "line": 255,
  8. "trace": [
  9. {
  10. "file": "C:\xampp\htdocs\DS_dev_01\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php",
  11. "line": 242,
  12. "function": "methodNotAllowed",
  13. "class": "Illuminate\Routing\RouteCollection",
  14. "type": "->"
  15. },
  16. ...
  17.  
  18. <a href="#" class="assetName" data-type="text" data-name="split_amount" data-url="update-investment-row" data-pk="{{ $investment_split->id }}" data-title="Edit Amount" data-value="{{$investment_split_yours}}">${{number_format($investment_split_yours)}}</a>
  19.  
  20. Route::post('atcv-split-scenario/update-investment-row', 'InvestmentLineSplitController@updateRow')->middleware('auth');
  21.  
  22. /**
  23. * Update the specified resource in storage.
  24. *
  25. * @param IlluminateHttpRequest $request
  26. * @param Appinvestment_line_split $investment_line_split
  27. * @return IlluminateHttpResponse
  28. */
  29. public function updateRow(Request $request, investment_line_split $investment_line_split)
  30. {
  31.  
  32. $pk = $request->input('pk');
  33.  
  34. $splitRecord = $investment_line_split::findOrFail($pk);
  35.  
  36. // get column name
  37. $col = $request->input('name');
  38.  
  39. // get new value
  40. $value = $request->input('value');
  41.  
  42. $splitRecord->$col = $value;
  43. $splitRecord->save();
  44.  
  45. return Response::json(array('status' => 1));
  46. }
  47.  
  48. $(document).ready(function() {
  49.  
  50. $.fn.editable.defaults.mode = 'popup';
  51. $.fn.editable.defaults.send = "always";
  52.  
  53. $.fn.editable.defaults.params = function (params)
  54. {
  55. params._token = $("#_token").data("token");
  56. return params;
  57. };
  58.  
  59. $.fn.editable.defaults.success = function(response, newValue)
  60. {
  61. //if(!response.success) return response.msg;
  62. window.location.reload();
  63. };
  64.  
  65. $('.assetName').editable({
  66.  
  67. ajaxOptions: {
  68. dataType: 'json',
  69. type: 'post'
  70. }
  71.  
  72. });
  73. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement