Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
935
Mouse-hover in data-grid from field in data-grid
posted

I am roughly on latest AG/ID (14.2).

I have a data grid which represents scenarios (name, start, end, etc.) to which users want to add a field for comments (to describe purpose for oddly-suffixed scenario names). Adding the field is simple enough, but the intent is to use that comment as the mouse-hover text for the scenario name.

How is it that I set a mouse-hover text value for a field which is declared as below, and how to I reference the same row's comment field?

		<igx-column
			[pinned]="true"
			field="name"
			header="Scenario Name"
			[dataType]="'string'"
			[resizable]="true"
			width="12%"
			[sortable]="true">
			<ng-template igxCellEditor let-cell="cell">
				<igx-input-group type="border">
					<input
						igxInput
						[igxFocus]="true"
						[(ngModel)]="cell.editValue"
						(ngModelChange)="modelChange($event, cell, 'name')"
						displayDensity="compact" />
				</igx-input-group>
			</ng-template>
		</igx-column>

Parents Reply
  • 2680
    Offline posted in reply to Chris Sworen

    Hi Chris,

    Thank you for following up!

    I have modified the previously referenced sample to also include a cell editing template with the same span and tooltip elements.

    On my side everything is working as expected as the cell context provides info about the row and its data there as well and the tooltip correctly displays another column’s value. Could I ask you to please have a look at the sample again and eventually compare any discrepancies between it and your own template’s code? The only possible root cause I can currently think of is probably a typo in the data source’s filed name – “createdBy” as you have written.

    Please, keep in mind, though, that I am not really familiar with your data model, such as what a “scenario name” represents, .etc.

    By your description, I was under the impression it is a field in your data. In case I am missing an aspect of your requirement, please, provide further details on the same. If the information you would like to display in a tooltip cannot actually be found in the data record, maybe a getter/public field in the .ts file is indeed what has to be implemented. You could use the cellEditEnter event for instance, to extract information about the currently edited cell and set the value of this variable based on it.

    Thank you for your cooperation.

    Best regards,
    Bozhidara Pachilova
    Associate Software Developer

Children