Skip to content

Replies

0
[Infragistics]Tacho
[Infragistics]Tacho answered on Feb 12, 2019 7:02 AM

Hello Mihir,

Thank you for your feedback.

I have attached a sample application that demonstrates the use of the IgxTooltip and the title attribute as described in my previous reply and I was unable to reproduce the issue you mentioned.

Please feel free to modify the sample accordingly, so the issue is reproduced and reattach it here, so we can examine it further.

If you have any questions, please let us know.

5710.gridWithTooltips_2800_Modified_2900_.zip

0
[Infragistics]Tacho
[Infragistics]Tacho answered on Feb 5, 2019 2:57 PM

Hello AMIT,

Thank you for the code-snippet you have provided.

In order to apply a static tooltip to a column's header, you can use both the IgxTooltip and the title attribute by retemplating the actual header of the column.

Here is an example of how to use both:




Name tooltip

{{column.field}}






 

{{column.field}}


If you have any questions, please let me know.

0
[Infragistics]Tacho
[Infragistics]Tacho answered on Jan 4, 2019 10:59 AM

Hello Scott,

Thank you for your question.

In order to attach an igxTooltip to each cell of the igxGrid by modifying the tooltip's content dynamically, I can suggest you create a single tooltip element in your markup and by templating the cells of the grid, you can mark all the cells as targets for that same tooltip.
In addition, you can handle the onTooltipShow event for every target (the cell) by updating the context property of the igxTooltip with any data that is relevant to the specific cell. In the below example, we pass the cell itself as a context to the igxTooltip and this way the tooltip has a direct reference to the necessary data.


Value of cell: {{tooltipRef.context.value}}
{{cell.value}}
...

I have attached a sample application that demonstrates the approach from above.

For more details on using the IgxTooltip and the IgxTooltipTarget directives, you can take a look at the following topic.

If you have any questions, please let me know.

6888.gridWithTooltips.zip

0
[Infragistics]Tacho
[Infragistics]Tacho answered on Apr 3, 2018 8:53 AM

Hello Aravind,

Thank you for the feedback.

I am glad to know that you were able to achieve the functionality you were looking for.

Our support team will update you on the new issue you have referred to as soon as they are ready with their investigation.

Thank you for using Infragistics components.

0
[Infragistics]Tacho
[Infragistics]Tacho answered on Mar 30, 2018 8:14 AM

Hello Aravind,

Thank you for the detailed description you have provided.

A) Add feature
When the BatchUpdating is set to True, the changes to the row will not be sent to the server until a postback is triggered. We can manually trigger the necessary postback by invoking the get_rowAdding()._commitRow() method as you have done in the provided code-snippet.
(When the BatchUpdating is set to False, the changes to the row will be automatically sent to the server.)

The approach looks good and please note that since these events are handled with custom logic, any additional changes have to be carefully integrated when using them in your application.

B) Edit feature
Here 1 and 2 look good as well and the same statement for the custom logic applies here too.

In order to detect if a cell has changed its value, you can use the EditingClientEvents.CellValueChanged (it will fire only if the client types a value that is different from the original one). This way we can set the isAlreadyRowEdited variable to true and handle the ExitedEditMode accordingly.


    
        
        ...
    
var isAlreadyRowEdited = false;
function EditingEvents_CellValueChanged(sender, e) {
    isAlreadyRowEdited = true;

    // The old value of the cell (if we need it)
    var oldValue = e.get_oldValue();

    // The new value of the cell (if we need it)
    var newValue = e.get_cell().get_value();
}

function RowEditing_ExitedEditMode(sender, e) {
    var grid = $find("dataGrid");
    if (isAlreadyRowEdited) {
        grid.get_behaviors().get_editingCore().commit();
        isAlreadyRowEdited = false;
        alert("row commited!");
    }
}

If you have any questions, please let me know.

0
[Infragistics]Tacho
[Infragistics]Tacho answered on Mar 29, 2018 11:56 AM

Hello Aravind,Thank you for the feedback.It seems you are referring to similar issues in this thread and in the case you have created, so in order to better keep track of the them I will continue updating you on this thread.Since the application you have provided contains some additional custom implementation and logic, I have attached a trimmed down sample with a WebDataGrid that demonstrates the behaviors I have mentioned and by targeting the issues you have referred to in the case.1. The values in the add row are not carried back to the server if the row is just there. (This is why we cannot use the RowAdding.Row property in this case) It only happens if the add row commits itself. This would fire the RowAdding event. Off of those event args, you would have access to the values from the add row.

 protected void dataGrid_RowUpdating(object sender, RowUpdatingEventArgs e)
{
    var values = e.Values;
    var row = e.Row;
}

2. In order to allow editing for a specific row only, it would be best to use the client side event – RowEditingClientEvents-EnteringEditMode (there is no analogical server event), because it will allow you to easily allow or cancel the editing of the current row based on your specific logic. In the attached sample, editing is allowed only for the second row.

function RowEditing_EnteringEditMode(sender, e) {
    // Allow Editing only for row with index==1.
    //
    var editingRow = e.getCells()[0].getCell().get_row();
    if (editingRow.get_index() !== 1) {
        e.set_cancel(true);
    }
}

3. In order to get the existing row (in server-side) the has just been edited, you can use the Activation behavior:

var activeRow = dataGrid.Behaviors.Activation.ActiveCell.Row;

4. In order to disable the editing of the entire grid, setting the RowEditing.Enabled to false will be enough:

dataGrid.Behaviors.EditingCore.Behaviors.RowEditing.Enabled = false;

In the sample that is attached in this reply: Initially only the second row will be available for editing (refer to 2.) Clicking the “Disable editing of grid” button will disable the editing functionality of the grid entirely and it will get the active row as a demonstration. (refer to 3. and 4.) New rows can be added to the grid through the add row by using Enter, Tab or clicking an existing row (each row should have a unique id). No manipulation over the view state properties is required, so I can suggest you use their default values.Please note that the approaches from above are merely guidelines for implementing specific logic for the WebDataGrid and any additional behaviors and logic will have to be manually implemented.If you have any questions, please let me know.

WebDataGrid_Sample

0
[Infragistics]Tacho
[Infragistics]Tacho answered on Mar 28, 2018 3:30 PM

Hello Aravind,

Thank you for the detailed description of the issues you have encountered.

1. The rows in the WebDataGrid get committed and the RowUpdating event gets fired after a row has been edited and it has been deactivated (for example clicking another row). Prior to this, the event will not fire and the RowEditing.Enabled property is not yet set to false.
In order to commit the row manually after the user has finished editing it, I can suggest you use the RowEditingClientEvents-ExitedEditMode event by invoking the commit method of the editing core.




function RowEditing_ExitedEditMode(sender, e) {
    var grid = $find("dataGrid");
    grid.get_behaviors().get_editingCore().commit();
}

2. The issue in regards to the RowAdding not being triggered by clicking another row seems to be the same as the one you are having at the following thread, to which I have already replied.

3. In order to get the add new row, you can use the RowAdding.Row property.

dataGrid.Behaviors.EditingCore.Behaviors.RowAdding.Row

If you have any questions, please let me know.