鼠标悬停事件p-dataTable表格单元格

时间:2018-03-01 14:56:26

标签: angular primeng primeng-datatable

我使用import csv import numpy as np import matplotlib.pyplot as plt % matplotlib inline from scipy.optimize import minimize import glob import cv2 #Fitting function============================================================ def f(): '''Process of constructing a curve that has the best fit to a series of data points''' fit_x = x1+Rz*np.cosh((1/Rz)*(y-y1-(z/2))) x_sq = (x-x1)**2 y_sq = Rz**2-(y-y1)**2 diff_sq = (x-(x1+Rz*np.cosh((1/Rz)*(y-y1-(z/2)))))**2 add_diff_sq = sum(x-(x1+Rz*np.cosh((1/Rz)*(y-y1-(z/2)))))**2 return fit_x, x_sq, y_sq, diff_sq, add_diff_sq #Initial guesses============================================================== x1 = 19.783 y1 = 20.647 Rz = 2.884 guesses = [x1, y1, Rz] #Open file==================================================================== with open('data_test01.csv') as csvfile: reader = csv.reader(csvfile, delimiter=',') for row in reader: x = float(row[0]) y = float(row[1]) z = float(row[2]) #Step 1======================================================================= fit_x, x_sq, y_sq, diff_sq, add_diff_sq = f() '''First fitting approximation''' print(f()) TypeError: 'numpy.float64' object is not iterable #Step 2======================================================================= res = minimize(f(), guesses, method='SLSQP') '''Minimizes the objective function to achieve a better fit''' print(res) TypeError: 'tuple' object is not callable 来保存我的手机信号。高度一致,我希望能够在text-overflow:ellipsis PrimeNG中使用鼠标悬停显示完整内容。

1 个答案:

答案 0 :(得分:0)

您可以对您的单元格使用templating

<p-column field="color" header="Color">
    <ng-template let-col let-data="rowData" pTemplate="body">
        <span title="{{data[col.field]}}">{{data[col.field]}}</span>
    </ng-template>
</p-column>

并使用Primeng tooltip组件或仅使用范围上的title属性。

相关问题