0

I have an object that acts like a cursor(table) and it's like this:

function cursor() {
  this.code = "";
  this.name = ""; }

Then I have a variable that will be used as the cursor itself:

var lib_book = new cursor();

Then I have a table with a custom attribute 'record_source' which is referenced to my cursor:

<table record_source="lib_book" id="grdbook">

Now I have a Refresh_Record function that binds the cursor to the table object. I can do it with this code: (sorry for not including all the codes)

Refresh_Record(lib_book,grdbook);

Now the question is this, is there a way to change the code to this:

Refresh_Record(grdbook);

since I have lib_book as an attribute. But lib_book is just a string there. Is there a way that I can reference the record_source attribute to the actual cursor?

4

1 回答 1

0

将所有游标保存在全局数组中,并将游标的数组索引保存为表中的属性。

您可以使用 eval 以其他方式执行此操作,但使用 eval 不是一个好主意

于 2012-05-17T04:32:58.127 回答