m_pGrid = CLuaGridUtil();
m_pGrid:SetGrid(ui:getDialogName(),'id_grid');
local help = CSelectHelp();
local sql = [[select top 100 * from bs_eqpt with(nolock) where isnull(is_delete,0)=0]];
if db:select(sql,'',help) < 0 then
return ui:tip(db:error());
end
m_pGrid:FromSelectHelp(help);
local helpSel = CSelectHelp();
m_pGrid:GetSelectedValue(helpSel);
if helpSel:size() <= 0 then
return;
end
m_pGrid:setColumnCode('id_grid');
m_pGrid:EnableColName('eqpt_id',false);
for i=0,m_pGrid:rowCount()-1 do
print(m_pGrid:getValue(i,'eqpt_name'));
end