简体   繁体   English

JQGrid映射问题:使用来自两个相关表的数据填充JQGrid

[英]JQGrid mapping issue: Populating JQGrid with data from two related tables

I'm currently working with two tables that I'm accessing through NHibernate entity framework: - Invoices - InvoiceItems 我目前正在处理两个我通过NHibernate实体框架访问的表: - 发票 - InvoiceItems

I need to create an Invoice Items report and include the Invoice table infomration on it as well. 我需要创建一个发票项目报告,并在其上包含发票表格信息。

The two tables are connected by InvoiceId. 这两个表由InvoiceId连接。 To populate my report data I created a model for the JQGrid that's connected to the "InvoiceItems" data model ( that's where I get the data from ). 为了填充我的报告数据,我为JQGrid创建了一个模型,该模型连接到“InvoiceItems”数据模型(我从中获取数据)。

My problem is that I can't seem to figuire out how to populate the "InvoiceItems" report with the "Invoice" table field values. 我的问题是,我似乎无法想象如何使用“Invoice”表字段值填充“InvoiceItems”报告。 Errors such as [Property 'InvoiceDate' not found on Namespace.InvoiceItems] or just [NaN NaN] keep showing up in columns where the information from the parent [Invoices] table should be. 诸如[Namespace.InvoiceItems上找不到[Property'InvoiceDate']或仅[NaN NaN]的错误会一直显示在父[发票]表中的信息所在的列中。 I tried using 'InvoiceItems.Invoices.InvoiceDate' syntax for example to map the grid colNames to data names but it doesn't work. 我尝试使用'InvoiceItems.Invoices.InvoiceDate'语法将网格colNames映射到数据名称,但它不起作用。

So how can I map the "Invoices" table fields to the grid model that returns fields from both "Invoices" and "InviceItems" data models ? 那么如何将“发票”表格字段映射到返回“发票”和“InviceItems”数据模型中字段的网格模型?

Thank you in advance. 先感谢您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM