简体   繁体   中英

How do I make a Drop Down Picker in Slickgrid using SQL?

I am working with Slickgrid and trying to make a drop down picker editor to edit each box using only 3 options

Here is what I have been working with:

http://industrialdashboard.codeplex.com/wikipage?title=IndustrialSlickGrid

In the Column Properties section there is the option about drop down pickers and I have not been able to use it. This was my attempt in SQL table display query where all the other properties have worked as expected

USE [LadleTracker]
GO
/****** Object:  StoredProcedure [dbo].[TableEquipment]    Script Date: 06/17/2013 11:38:20****/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[TableEquipment]
AS
BEGIN
SELECT
[ID!id] = equip.id
,[ID key!al!rq!wd:64px] = equip.id
,[tag id!wd:64px!ac] = equip.RFID 
,[Name!al] = equip.Name 
,[Equipment_Type!{type:"dpp",data:"dbo.DDPEquipmentType"}] = equip.EquipmentType
,[Last Detected by!al] = ant.name
,[Heat!al] = equip.HeatInLadle

FROM dbo.Equipment equip
LEFT OUTER JOIN dbo.Antennas ant on equip.Location = ant.id

ORDER BY equip.id ASC
END

dbo.DDPEquipmentType is a table with the INT value that is stored in dbo.Equipment for EquipmentType and the String name Intended for the user to see in the Drop Down Picker.

The HTML and JavaScript are set up and have taken every other Column Property properly but this box column is just standard edit and shows the INT value, not the string

Thanks in Advance

,[Active!{widget: {Type:'ddp', Procedure:'dbo.DDPEquipmentActive_Proc'}}] = equip.Active

This is the line in the SQL stored procedure that is used to return the table.

equip is the table being referenced and displayed in the slickgrid

dbo.DDPEquipmentActive_Proc is a stored procedure that returns the table used in making the drop down picker:

title        ActiveState
Inactive     0
Active       1
Unkown       2

where title (I think the column has to be named title) is what is shown in the drop down picker and the other column is what is returned as a parameter for the edit function.

This works to display the name in the column even when not editing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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