尝试在x-editable中确定值时,我收到以下异常.[例外......""nsresult:"0x805e0006()"location:"JS frame :: :: .send :: line 8400"data:no]
View Code:
<?php $this->widget('bootstrap.widgets.TbGridView', array(
'id' => 'subjectgrid',
'itemsCssClass' => 'table-bordered items',
'dataProvider' => new CActiveDataProvider('Examschedule',array(
'criteria'=>array('condition'=>"examcode=:newexam and sessioncode=:sessioncode",
'params'=>array(':newexam'=>$examcode, ':sessioncode'=>$sessioncode),),
'pagination'=>array('pageSize'=>15),)),
'columns'=>array(
array('name' => 'examcode', 'headerHtmlOptions' => array('style' => 'width: 10px'),),
array('name' => 'sessioncode', 'headerHtmlOptions' => array('style' => 'width: 10px'),),
array('name' => 'subjectcode', 'headerHtmlOptions' => array('style' => 'width: 10px'),),
array('name' => 'groupcode', 'headerHtmlOptions' => array('style' => 'width: 10px'), ),
array('class' => 'editable.EditableColumn', 'name' => 'dateofexam', 'headerHtmlOptions' => array('style' => 'width: 10px'), …Run Code Online (Sandbox Code Playgroud) X-Editable(bootstrap 2版本)无法正常运行Chrome.单击按钮时,没有任何更改(保存和放弃更改).看起来x-editable没有响应click事件.更重要的是,控制台没有记录任何错误.适用于Firefox 25和IE 10.
试图使用正常和缩小版本.
我是ReactJS的新手,我正在尝试创建一个Reactjs组件,它是使用x-editable的可编辑字段列表.
根据x-editable文档,我需要.editable()为每个字段调用,通常这是通过jQuery访问元素完成的.
我怎么能用React做到这一点?必须在安装组件时完成,我无法找到方法来了解组件何时呈现...
我想知道实现这一目标的最佳方法; 我看了一下React,refs但我不确定它可以提供帮助.所以,我最终给它一个特定的类,然后使用选择调用editable()上的字段,但它只能在渲染已经完成,我不觉得它很优雅.
JS(X)代码:
var EditableField = React.createClass({
render: function() {
return <p>{this.props.name}: <a href="#" className="editable_field" name={this.prop.name} data-type="text" data-title="Edit value">{this.props.value}</a></p>
}
});
Run Code Online (Sandbox Code Playgroud)
在脚本代码中:
$(document).ready(function() {
$.fn.editable.defaults.mode = 'inline';
$(".editable_field").editable();
Run Code Online (Sandbox Code Playgroud) 我正在使用http://vitalets.github.io/x-editable/并希望使用Ajax验证输入.为了测试,我创建了以下脚本https://jsfiddle.net/m698gxgj/1/.
我的Ajax请求是异步的,所以我相信validate回调返回undefined,因此它不会导致输入验证失败.
我"可以"将我的Ajax请求更改为同步,但我读到的所有内容(/sf/answers/995422641/)表明这不是一个好主意.
这是如何完成的?
<p>Name</p><a href="javascript:void(0)" id="name"></a>
$('#name').editable({
type: 'text',
title: 'Name',
url: '/echo/json/',
pk: 123,
validate: function (value) {
if (value == 'bob') {
return 'bob is not allowed';
} else {
$.post('/echo/html/', {
html: 'false',
delay: .5
}, function (result) {
if (result == 'false') {
console.log('remote error');
return 'remote error';
}
});
}
}
});
Run Code Online (Sandbox Code Playgroud) 我试图在ng-repeat中构建angualr x-editable表单但是当我尝试通过控制器中的$ scope访问表单时,我收到错误.
<div ng-repeat="course in box.value track by $index">
<form editable-form name="{{box.key}}{{$index}}">
.....
<button
type="button"
class="btn btn-primary"
ng-click="formAction(box.key, $index, 'show')">Edit
</button>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
在JavaScript中,我有以下内容,但这会在执行时导致错误.
$scope.formAction = function (key, index, action) {
var formName = key + index;
if (action === 'show') {
//console.log(formName) shows correct form name yet
//Error!! TypeError: Cannot read property '$show' of undefined
$scope[formName].$show();
}
};
Run Code Online (Sandbox Code Playgroud)
x-editable手册说形式名称="{{box.key}} {{$ index}}"应该在$ scope上创建一个属性但是当我在console.log($ scope)时我找不到属性
对于Twitter Bootstrap X Editable(https://vitalets.github.io/x-editable/docs.html),有成功和错误的回调.但没有什么可以取消的.有没有办法监听特定可编辑的取消事件?
如何修复此代码的安全流程:
<a href="http://localhost/mypay/admin/company/#"
data-pk="26" data-url="http://localhost/mypay/admin/company/update/profile"
id="name"
name="name"
data-type="text"
data-source="">dfg</a>
Run Code Online (Sandbox Code Playgroud)
这使用x-editable [bootstrap] - http://vitalets.github.io/x-editable/
我很好奇如果客户端更改数据的"PK"主键,如何提高我的应用程序的安全性.身份证必须放在哪里或者我会创建哪些其他安全措施来阻止他们这样做?
我使用:Bootstrap和Codeigniter.
我想在单击编辑按钮时只读取一个字段,但是在单击添加按钮时可以输入值.我试过角度ng-readonly但到目前为止还没有工作.有什么建议?
HTML
<tr ng-repeat="row in rowCollection">
<td><span editable-text="row.inputToken" e-name="inputToken" e-form="gridForm" ng-disabled="row.isreadonly">{{row.inputToken}}</span></td>
<td><span editable-text="row.standardForm" e-name="standardForm" e-form="gridForm">{{row.standardForm}}</span></td>
<td><span editable-select="row.classification" e-name="classification" onshow="" e-form="gridForm">{{row.classification}}</span></td>
<td><span editable-text="row.similarityThreshold" e-name="similarityThreshold" e-form="gridForm">{{row.similarityThreshold}}</span></td>
<td style="white-space: nowrap">
<form editable-form name="gridForm" onbeforesave="saveRecord($data)" ng-show="gridForm.$visible" class="form-buttons form inline" shown="inserted == row">
<button type="submit" ng-disabled="gridForm.$waiting" class="btn">Save</button>
<button type="button" ng-disabled="gridForm.$waiting" ng-click="cancelRecord();gridForm.$cancel()" class="btn">Cancel</button>
</form>
<div class="buttons" ng-show="!gridForm.$visible">
<button class="btn" type="button" ng-click="gridForm.$show()">Edit</button>
<button class="btn" type="button" ng-click="deleteRecord($index)">Delete</button>
</div>
</td>
</tr>
</tbody>
Run Code Online (Sandbox Code Playgroud)
Controller.js
var stan = angular.module('stanuiApp', ['ui.bootstrap','smart-table','xeditable']);
stan.run(function(editableOptions){
editableOptions.theme = 'default';
});
stan.controller('MainCtrl',function ($scope, $window, $http,$filter) {
$scope.root …Run Code Online (Sandbox Code Playgroud) 任何帮助将不胜感激我尝试下面的代码为x-editable版本1.5.0其他选项,如:'weekStart'工作但像'setDate','defaultViewDate'这样的选项不起作用是我的代码有问题?我的代码:
<a href="#" id="dob" data-type="date" data-pk="1" data-title="Select date">15/05/1984</a>
<script type="text/javascript>
$('#dob').editable({
format: 'yyyy-mm-dd',
viewformat: 'dd/mm/yyyy',
datepicker: {
weekStart: 1,
defaultViewDate: {
year: 2012,
month: 11,
day: 11
}
}
});
</script>
Run Code Online (Sandbox Code Playgroud) x-editable ×9
javascript ×3
jquery ×3
angularjs ×2
php ×2
ajax ×1
codeigniter ×1
reactjs ×1
security ×1
yii ×1