Hi all,

I need to dynamically set the above during run time. I checked the api_datasource but could not find anything. I tried the api_panel.disableall. But the panel itself disappears.

George.

asked 25 Apr '13, 04:32

George's gravatar image

George
1111228
accept rate: 0%


Hi George,

I guess you are aiming to prevent DML dynamically. If it's so, the DML permissions are kept in datasource definition level and it's not possible to change the dataource definition properties during runtime.

Therefore, in your case, api_panel.disableAll is a right choice. But obviously, the disabled panel should not disappear. Can you send the panel XML and your action code and specify the browser that you are using while running your application?

Regards,
Ibrahim

link

answered 25 Apr '13, 04:50

Ibrahim%20Sandalli's gravatar image

Ibrahim Sand... ♦♦
1.5k5
accept rate: 25%

Hi Ibrahim,

I gave disableall('CM_PARA_GRID') at application startup. And the panel got disappeared. However, when I gave it at the panel initialization it is disabling correctly. However, I cannot still use this solution because the user is not able browse through the data. Panel remain frozen with whatever data was show in the beginning and cannot go to other records after that. What I need is a facility where one user may do DML operations on a table while another user is not permitted DML. Both users will use the same panels. Kindly suggest a solution.

George.

(25 Apr '13, 05:47) George

Hi George,

What's the method used to navigate different records of the grid?

If you navigate through custom buttons like next/previous page/record you can enable these buttons after the api_panel.disableAll API call using api_component.setEnable API (or api_panel.enableAll API after grouping and placing these buttons into a separate panel).

If you navigate using the scollbar of the grid and the arrow keys while the focus is in the grid, you have to use the editable property instead of the enable property of the grid. Therefore, if the CM_PARA_GRID panel contains only a grid, you can use api_component.setEditable API for the grid instead of the api_panel.disableAll. If CM_PARA_GRID panel contains some other components that needs to disabled, you can call api_panel.disableAll, api_component.setEnable to enable the grid and api_component.setEditable to make the grid uneditable.

Hope this helps,
Ibrahim

(25 Apr '13, 06:45) Ibrahim Sand... ♦♦

Hi Ibrahim,

Thank you for your kind help. Document approval is a very important part of any ERP solution. Once a transaction is approved it should not be available for any kind of editing. At the same time other unapproved transactions should be editable. This means conditionally enabling/disabling editing of records. This should apply to all the datasources and panels in the transactions. The formspider team has to think and design the product for the enterprise. Then only the end product can be used for that purpose. Kindly do something about adding this feature in formspider.

George.

(26 Apr '13, 00:25) George

Hi George. The Grid supports row and cell level conditional editing. I'll look for an example.

(26 Apr '13, 02:28) Yalim Gerger ♦♦

Thanks Yalim,

I am waiting.

George.

(26 Apr '13, 02:56) George

Hi George,

While using grid component, you can use the editableColumn attribute to set the editable state of an entire row conditionally. You can find more details about how to use this attribute in this tutorial.

Also, you can use api_component.setEditable API by providing the in_primaryKey_tx parameter to set the editable state of a single component existing in the grid row specified by the in_primaryKey_tx parameter. This enables you to adjust the editable state of a specific column in record level.

I hope that these two features meet your request. If not, can you provide more details please?

Regards,
Ibrahim

link

answered 26 Apr '13, 03:17

Ibrahim%20Sandalli's gravatar image

Ibrahim Sand... ♦♦
1.5k5
accept rate: 25%

Hi Ibrahim,

Thank you very much.

I will try this.

. George/

(26 Apr '13, 03:42) George

Hi Ibrahim,

I tried the editableColumn method. It is working fine and I like it. But this cannot be used because it needs to be defined at the datasource. If it was available as an API then it was dynamic and useful as the condition for enabling/disabling a row many not be always know at design time.

However, I can make use of the api_component.setEditable with the primary key. I tested it and it is working. But I need to disable it only if the user tries to edit the row.

continued...

(27 Apr '13, 03:28) George

Is there an api to find out if the user starts editing/deleting a row? If not, the only method that can be applied is enable/disable the row on entering the row which is actually not necessary as user may not be planning to edit it.

George.

(27 Apr '13, 03:28) George

Hi George,

To find out if the user starts editing/deleting a row you would need an event rather than an API. Unfortunately, such an event doesn't currently exist in Formspider.

As an optional solution, you can define a valueChanged event on grid level and disable the row when the user quits the component after the edit, which means when the user ends edit.

(28 Apr '13, 12:32) Ibrahim Sand... ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×13
×9
×6
×6

Asked: 25 Apr '13, 04:32

Seen: 1,367 times

Last updated: 28 Apr '13, 12:32


© Copyright Gerger 2017