Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Edit Amount
- 212000.00
- {
- "message": "",
- "exception": "Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException",
- "file": "C:\xampp\htdocs\DS_dev_01\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php",
- "line": 255,
- "trace": [
- {
- "file": "C:\xampp\htdocs\DS_dev_01\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php",
- "line": 242,
- "function": "methodNotAllowed",
- "class": "Illuminate\Routing\RouteCollection",
- "type": "->"
- },
- ...
- <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>
- Route::post('atcv-split-scenario/update-investment-row', 'InvestmentLineSplitController@updateRow')->middleware('auth');
- /**
- * Update the specified resource in storage.
- *
- * @param IlluminateHttpRequest $request
- * @param Appinvestment_line_split $investment_line_split
- * @return IlluminateHttpResponse
- */
- public function updateRow(Request $request, investment_line_split $investment_line_split)
- {
- $pk = $request->input('pk');
- $splitRecord = $investment_line_split::findOrFail($pk);
- // get column name
- $col = $request->input('name');
- // get new value
- $value = $request->input('value');
- $splitRecord->$col = $value;
- $splitRecord->save();
- return Response::json(array('status' => 1));
- }
- $(document).ready(function() {
- $.fn.editable.defaults.mode = 'popup';
- $.fn.editable.defaults.send = "always";
- $.fn.editable.defaults.params = function (params)
- {
- params._token = $("#_token").data("token");
- return params;
- };
- $.fn.editable.defaults.success = function(response, newValue)
- {
- //if(!response.success) return response.msg;
- window.location.reload();
- };
- $('.assetName').editable({
- ajaxOptions: {
- dataType: 'json',
- type: 'post'
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement