Welcome, Guest
Please Login or Register.    Lost Password?

Support for run-time parameters?
(1 viewing) (1) Guest
This is the optional Forum header for the Suggestion Box.
Go to bottomPage: 12
TOPIC: Support for run-time parameters?
#411
Support for run-time parameters? 4 Months, 3 Weeks ago Karma: 0
Hi,

I have book looking at Table JX to handle the data I am building into a new site.

There's one aspect of fuctionality that I'm sure if it is included in Table JX.

Im my data, I have 30,000 records that belong to 100 customers.

I would like to create one Joomla article per customer and then display that customer's records. In each case the table containing the data will be the same. The only aspect that changes is the filter on customer name.

I don't want to define one view per customer. Is there any way I can define a single view and then pass a run-time parameter to the view when it is executed?

Or, are there other ways that I can solve this requirement?

With thanks
David
djb
Fresh Boarder
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#413
Re:Support for run-time parameters? 4 Months, 3 Weeks ago Karma: 1
Hi,

yes, you can. For example you can look at our download page or picture in documentation. The download page is made with TableJX. Each customer can see only his/her downloads.

Well, there are many solutions, depends on relation between data and users. You can have one-to-one, one-to-many, many-to-one, many-to-many ...

Let's say that you have one record for specific customer and one specific customer has many his/her records, then you will have joomla user id in records table as foreign key from table jos_users.

#|Item|id (these are ids from jos_users table (joomla users)
1|Car1|1
2|Car2|1
3|Car3|2

You can create view that looks like table above.
In WHERE section in admin area you just write id=@user_id. With this statement you have created filter. Then you put this grid on article that is in Registered Area (see joomla access levels) and when joomla user (your customer) opens this article, he/she will see only his/her data. No need to have many articles and many views, just one article and one view, that's all.

Best regards,
Viljem
viljem
Admin
Posts: 152
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#418
Re:Support for run-time parameters? 4 Months, 3 Weeks ago Karma: 0
Viljem,

I understand that now. Thank you for explaining that.

David
djb
Fresh Boarder
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#454
Re:Support for run-time parameters? 4 Months ago Karma: 0
Viljem,

Would you be able to have a look at a slightly different requirement that could use run-time paramaters please?

I have a view that contains 20,000 records. These records belong to 200 different organisations.

In my view I have the fields:

Org_id
Details_1
Details_2
Details_3 etc

In the grid I display the fields Details1, Details2 and Details3.

In my Joomla article I would like to use the org_id field to filter the records that are displayed.

I would like to use a command like:

{insertgrid ID = 2 where org_id=120}

but this doesn't work. The grid displays but there is no filtering of the records.

Unfortunately I can't use any of the in-built variables in this instance such as @user_id etc

Can you see how this can be done without definining individual views?

Thank you
David
djb
Fresh Boarder
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#457
Re:Support for run-time parameters? 4 Months ago Karma: 1
Hi,

do you want that a user that belongs to a specific organisation sees only this organisation's data when logs in registered area?

If yes, you need to have a relation between organisation and joomla user.

If one organisation has many users and one user belongs only to one organisation. This means that you have to have in jos_users table also column organisation_id. You create then view between tables jos_users, organisation and data.

Best regards,
Viljem
viljem
Admin
Posts: 152
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#460
Re:Support for run-time parameters? 4 Months ago Karma: 0
Viljem,

I don't have any users logging in from these organisations. Instead I want to display information about the organisation on that organisation's page.

As my site grows, I expect to have several hundred organisations so it would be great to find a solution for this.

Thank you for your quick response earlier
David
djb
Fresh Boarder
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 12
Tools JX, Powered by Joomla!; Joomla templates by SG web hosting