Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
dynamic colModel
19/04/2009
08:32
Avatar
hpoe
hpoe
Member
Members
Forum Posts: 29
Member Since:
07/03/2009
sp_UserOfflineSmall Offline

I am a jquery + jqGrid newbe, so I would be glad to get a few hints.

I have to present technical data for items of different dimensions in a searchable Grid.

Example: http://www.d-a.ch/site/index__.....-4480.html

The technical data can be from 1 to 35 columns including price with a maximum of 1200 rows, added complexityis that not all rows have all columns, so I would need to change the standard json or xmlreader.

My idea would by to generate the colModel and colNames including the select list, kind of Excel auto select.

Would it be better to generate the javascript configuration or a configuration xml. I would like to store the configuration in the database the first time the item is asked for.

We are using coldfusion. Any help appreciated!

TIA

hpoe

20/04/2009
07:04
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Could not answer, since the question is too common. It depends on how complex is your task

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

21/04/2009
08:22
Avatar
hpoe
hpoe
Member
Members
Forum Posts: 29
Member Since:
07/03/2009
sp_UserOfflineSmall Offline

OK, i try to ask differently.

I have create a grid for products which have very different configurations eg size, power, weight. 1 product on one html page, one coModel per product. colNames depending on selected language. In the grid the different dimensions / configurations / prices have to be shown. Moreover filtering with selection lists to all columns is a must, an of course paging.

I am not sure but I think my only option is to generate the javascript configuration the first time a product is called and save it language dependent in the database for later usage.

Generating an xml configuration would be easier, but I don't know how to include the option lists and the configuration for the search toolbar. The existing example is very basic and the json_test.txt and xml_test.xml files are not in the distribution package 3.4.3

07/05/2009
19:58
Avatar
alan
Member
Members
Forum Posts: 8
Member Since:
01/04/2009
sp_UserOfflineSmall Offline

I am doing something which sounds like what you are wanting to do, except I am using ASP instead of Coldfusion. Check this out and see if it helps...

<%

set rsMapFields=GetMapFields(reqMapID)

%>

  $("#list").jqGrid({

    url:'CategoryMapsCode.asp?map_id=<%=reqMapID%>',

    datatype: 'xml',

    mtype: 'GET',

<%

colNames="colNames:['ID','map_id','segment_id','Segment'"

rsMapFields.MoveFirst

Do While Not rsMapFields.EOF 'set read-only fields as so

colNames=colNames &",'"& rsMapFields.Fields("field_column_description").value &"'"

rsMapFields.MoveNext

Loop

colNames=colNames &"],"

Response.Write(colNames)

%>

colModel :[ 

{name:'row_id', index:'row_id', width:35, hidden:false, hidedlg:true}, 

{name:'map_id', index:'map_id', width:40, hidden:true, hidedlg:true}, 

{name:'segment_id', index:'segment_id', width:35, editable:true, hidden:true, hidedlg:true},

{name:'segment_name', index:'segment_name', editable:true, width:45, edittype:"select", editoptions:{value:"<%=tSegmentList%>"}}<%

rsMapFields.MoveFirst

Do While Not rsMapFields.EOF 'set read-only fields as so

field_name=rsMapFields.Fields("field_column_name").value

field_addable=rsMapFields.Fields("input_for_new_record").value

field_width=rsMapFields.Fields("column_width").value

tValue=""

if field_addable="1" then tValue=", editable:true" end if

if len(field_width) > "0" then tWidth=", width:"&field_width end if

reqSegmentID=tSegmentID

if not IsNull(rsMapFields.Fields("option_values_function").value) then

set rsValues=Eval(rsMapFields.Fields("option_values_function").value)

Do While Not rsValues.EOF 

tParamValue=trim(rsValues.Fields("param_value").value)

if len(tParamList) < 1 then

tParamList=tParamValue &":"& tParamValue

else

tParamList=tParamList &";"& tParamValue &":"& tParamValue

end if

rsValues.MoveNext

Loop

CloseRecordSet(rsValues)

field_definition=",{name:'"& field_name &"', index:'"& field_name &"' "& tValue & tWidth & ", edittype:""select"", editoptions:{value:""" & tParamList & """}}"

else

field_definition=",{name:'"& field_name &"', index:'"& field_name &"' "& tValue & tWidth &"}"

end if

Response.Write(field_definition)

rsMapFields.MoveNext

Loop

Response.Write("],")

%>

sortname: "row_id",

    pager: $('#pager'),

    editurl:'CategoryMapsModify.asp',

    rowNum:30,

    rowList:[10,20,30,50,100,300,500,1000],

    sortorder: "desc",

    viewrecords: true,

    height: 'auto',

......................

08/05/2009
05:38
Avatar
hpoe
hpoe
Member
Members
Forum Posts: 29
Member Since:
07/03/2009
sp_UserOfflineSmall Offline

Alan thanks, this would be a solution. I used another way to do it, because it would be too much to handle in a script.

We have about 20000 different item configurations, each with up to 30 attributes and up to 1500 configs per item configurations and 3 languages.

[Image Can Not Be Found]: http://ruegg.mediando.ch/image.....web003.png[Image Can Not Be Found]

[Image Can Not Be Found]

one page is set up for one item, each row in the grid is a specific item with specific attributes plus price, which make up the row.

Fix in the grid is only the item no on the left and the price on the right.

My solution for this solution was to create a stored proc which created the select for the grid from basically 3 tables (items, item_attr and prices), the colModel and the colNames and the result of this procedure is stored in a table.

At runtime I add the colmodel and colnames from this table to the javascript and I let again a stored proc execute the generated select in a coldfusion component.

This performs quite wll, I just have a few formatting problems. e.g. the right most price column is cut off, but that's another story.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
165 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information