CXJS - 如何从 Gridcell 中的 link onclick 获取 record.id
CXJS - How to get the record.id from link onclick within the Gridcell
我仍在学习有关 react 和 cxjs 的东西。我正在尝试开发一个查找小部件,它会弹出一个带有网格的 window,用户可以从中搜索并 select 一个条目。
我想在 cxjs 网格单元格中使用 Link,当单击 link 时,我需要调用具有该特定行 ID 的控制器方法 (record.id)。以下是我尝试过但没有成功的方法。
.....
style="max-width: 500px; width: 500px; max-height:500px;"
border={false}
columns={[
{
field: 'name', sortable: true,
items: <cx>
<Link onClick={(e, ins) => {
ins.store.set("$lookup.selText", e.? /* can I use e to get id and set it to store */);
ins.controller.selectRecord("{$record.id}"); // this doesn't work either
ins.parentOptions.dismiss();
}} text-tpl="{$record.name}"/>
</cx>,
header: {
style: 'width: 150px',
items: 'Name'
},
},
有人能给点提示吗?
谢谢,
普里扬加
您可以使用 get 函数从存储中获取值。
store.get("$record.id")
我仍在学习有关 react 和 cxjs 的东西。我正在尝试开发一个查找小部件,它会弹出一个带有网格的 window,用户可以从中搜索并 select 一个条目。
我想在 cxjs 网格单元格中使用 Link,当单击 link 时,我需要调用具有该特定行 ID 的控制器方法 (record.id)。以下是我尝试过但没有成功的方法。
.....
style="max-width: 500px; width: 500px; max-height:500px;"
border={false}
columns={[
{
field: 'name', sortable: true,
items: <cx>
<Link onClick={(e, ins) => {
ins.store.set("$lookup.selText", e.? /* can I use e to get id and set it to store */);
ins.controller.selectRecord("{$record.id}"); // this doesn't work either
ins.parentOptions.dismiss();
}} text-tpl="{$record.name}"/>
</cx>,
header: {
style: 'width: 150px',
items: 'Name'
},
},
有人能给点提示吗?
谢谢,
普里扬加
您可以使用 get 函数从存储中获取值。
store.get("$record.id")