the chechkbox keeps the last selected row - visual-foxpro

I have a form with a grid, the first column is not in the packages table, I added a checkbox. For example, if I select the second row in the checkbox, it stays selected even after closing the form.
The value of the checkbox is not stored in the table, how do I do it so that when the form is reopened the checkbox does not have any rows selected?
SET PATH TO "C:\Users\ives\Documents\Visual FoxPro Projects\delivered\dbfs"
USE IN 0 SHARED packages
Thisform.packages.RecordSource = "packages"
Thisform.packages.column2.ControlSource = "packages.code"
Thisform.packages.column3.ControlSource = "packages.name"
Thisform.packages.column4.ControlSource = "packages.address"
Thisform.packages.column5.ControlSource = "packages.phone"
Thisform.packages.refresh
thisform.packages.setfocus()
thisform.refresh
The value that is configured in the check1.value is 0, after configuring the recordsource and the grid source control, I have this code but the problem continues.

Every column in a grid has to have a ControlSource. If you're not specifying one, then the grid will choose one somewhere.
The typical way to use a checkbox in a grid for selection is to add a column to the table or cursor you're working with to hold that value, or to set up a cursor with a 1-1 relationship to your original table to hold the value.

Related

SSRS Dynamically Show Data

I am wondering if you can have other tables show based on the value selected in the main table. I am not opposed to drill-down either.
My main table is the summary and was hoping to show additional data when the user clicks on a Type. When clicked another table would be visible. For example, in the screenshot, the Pool table would be visible when the Pool type is clicked in the main report. As mentioned if this is easier as a drill-down then I will do that, but not sure how. The report currently has a dataset for each table. Do I need to combine the datasets to do a drill-down?
Main and child tables
The best way to accomplish what you described is with a drill down and you would need to combine the datasets into one.
Combine your datasets
Add a table to your report and reference the single dataset
Add your detail row group to the table - from your child table (Area, Average)
Add a parent group to your details row, group your detail row group by Type, it should add a Type column to your table. Delete this column and it will ask you to delete the associated group as well. Select the option to delete only the column.
Recreate your table by adding rows, be sure to match the grouping indicators (brackets) on the left side
Right-Click on the bottom row in the box where the bracket is to highlight the entire row, click Row Visibility. For the option "when the report is initially run:", select Hide. Check "Display can be toggled by this report item" and select the name of the textbox that contains [Type]. If you don't know what this is, exit out of the dialogue box and right-click on the cell [Type] and click Textbox properties, the Name will be in there
Repeat step 6 for the label row for your details row (second row from the bottom)

How to click on Web Table column's Web Button in following case?

I have one web table, in this I want to delete particular record by clicking on record's delete button.
I got the value of row but I am not able to perform click on web button of particular row and also there is 2 buttons in one column.
How to click on delete icon of particular row?
You need to set a reference to the item within the specific row and then click on it - something like this:
Set oLink = Browser("myBrowser").Page("myPage").WebTable("myTable").ChildItem(iRow,8,"Link",0)
oLink.Click
You will potentially need to amend the "Link" and the number 8 in your own code. iRow represents the row you are trying to interact with.
Essentially what this code does is set an object reference to the first item of type "Link", in column 8 of the table, then uses a Click event to select it. If your delete icon is a WebButton, then replace "Link" with "WebButton" for example. The final 0 in the command tells UFT to select the first element matching the object type - you might need 1 if your two icons are in the same column of the table.
Let me know if that helped.

How to save only change data in jqgrid?

I'm using jqgrid.
When the user execute (add/change/delete) rows more than often, and some documents have hundreds of rows.
If a user clicks the Save button, all rows (including no changed rows) are updated at once and it takes a while when rows are in the hundreds.
I just want to update the changed data only.
Is there any row status check function?
To verify whether the data has been changed or not during editing you can use the internal jqGrid option savedRow:
var row = $("#yourGrid").getGridParam("savedRow"); to get the data.
According to the documentation:
The array savedRow (option in the grid) is filled with the values before the editing. This is a name:value pair array with additional pair id:rowid
After the row is saved or restored the editable attribute is set to “0” and the savedRow item with id=rowid is deleted

How to add rows with values already predefined?

In Oracle APEX I have a tabular form that returns one row and has cancel, delete, submit, and add row buttons. When I click the add row button it adds an empty row to the form but I would like it to add a new row with certain columns already filled in containing the same data as the first row. I was thinking I'd have to add a PL/SQL process to the page. How would I go about doing this?
You could set the default value for each column in the report to be based on the value of a hidden item (a hidden item per column) and set the values of these hidden items in a page load process by running the same query that populates the first row of the report.

How to populate dynamically generated select boxes with ajax

I haven't been able to find a solution for the particular problem I'm having with this project. I need to the following: dynamically add rows to a table that contain two select boxes AND use ajax to auto-populate the select options of the 2nd select box, based on the value of the first select box... in the respective table row (that was dynamically added on the fly by some js).
Still with me?
I can easily populate, dynamically, a select drop-down using ajax/javascript based on the value of the first drop-down, in the first row. I can even populate three or more select boxes in the same row, using ajax/js functions to load each additional select. Yet, this is not my goal.
Here's what I have... My form contains a simple table with 3 columns. First is a checkbox, the second is the "State" select box and the third column is the "City" select box. I have two buttons above the table that allow me to "Add Row" and "Delete Row". Mind you, the first row (which is programmed-in), works perfectly for loading the city names of a state using ajax.
Upon clicking the Add Row button, I'm able to create the second row dynamically, which contains the checkbox, state select and city select fields. The state select is populated based on the innerHTML content of the original column, but the city select is obviously null because it is expecting ajax to fill it. Note: the names and ID names of these fields are iterative... city_id, city_id_1, city_id_2, city_id_3 and so on... so I have that uniqueness to work with.
My problem lies in the fact that when I select a state from the 2nd or 3rd (and so on) rows, only the firstcity select changes. Why? Because the js/ajax processing function says to operate only on the element with name "city_id"!! Which is the name of the city select box in the first row.
I have not (yet) found a way to dynamically pass the name of the element I need updated to the onreadystate ajax function. When I've needed to populate two or three select boxes in a row (same row), I've had to have complementary ajax functions for each drop-down - which are static, mind you... but what if I create the element dynamically?? I can't pre-program that many functions into my page... or must I?
If you have any ideas on how to accomplish this I would be soo damn appreciative!!!
Thanks!
var i=1; // put here the number of the column being added now.
var x=document.getElementById("city_id_"+i);
// populate x

Resources