我刚开始使用DataTables,在创建表时一切正常.
当我在表格中显示5,24,47行时,DataTables的行为与我期望的一样.
但我有这个表有大约700行,我在谷歌Chrome中得到错误,
"VM9075 dataTables.min.js:24Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined "
Run Code Online (Sandbox Code Playgroud)
在IE 9中,
"SCRIPT5007: Unable to set value of the property '_DT_CellIndex': object is null or undefined
jquery-1.10.2.min.js, line 4 character 2367"
Run Code Online (Sandbox Code Playgroud)
我没有包含两次btw的jQuery.
我不知道怎么从这里开始.
我试图使用.js文件的未经编译的版本来自己调试它,但我不断得到一个"ext"方法或属性未定义,也无法解决.
任何帮助表示赞赏!
我创建了以下类(精简版),继承人对完整文件的引用 https://github.com/cotyembry/CastRemoteNative/blob/7e74dbc56f037cc61241f6ece24a94d8c52abb32/root/ios/CastRemoteNative/NativeMethods.swift
@objc(NativeMethods)
class NativeMethods: RCTEventEmitter {
@objc(sendEventToJSFromJS)
func sendEventToJSFromJS {
self.emitEvent(eventName: "test", body: "bodyTestString")
}
func emitEvent(eventName: String: body: Any) {
self.sendEvent(withName: eventName, body: body)
}
}
Run Code Online (Sandbox Code Playgroud)
当我调用emitEvent类似下面的方法时,这完美地工作并触发我的javascript代码中的回调监听器,它是来自https://github.com/cotyembry/CastRemoteNative/blob/7e74dbc56f037cc61241f6ece24a94d8c52abb32/root/js/Components/的修改后的片段
ChromecastDevicesModal.js
从JavaScript方面来看
import {
NativeModules,
NativeEventEmitter
} from 'react-native'
//here I bring in the swift class to use inside javascript
var NativeMethods = NativeModules.NativeMethods;
//create an event emitter to use to listen for the native events when they occur
this.eventEmitter = new NativeEventEmitter(NativeMethods);
//listen for the event …Run Code Online (Sandbox Code Playgroud)