Javascript for enable and dissable td in table

倾然丶 夕夏残阳落幕 提交于 2019-12-13 04:22:04

问题


I have three td for cost field in a grails project, I have added three cost like 300, 400, 500 in individual td and I have jeditable for editing each td and adding someother value for it by submitting it, that value will get added to the database, my problem is, I clicked three td simultaneously and edited the the first value for example 300 to 600 and clicked the submit button but the edited value 600 gets updated to all other td like 400 to 600 and 500 to 600, what I need is a javascript function for disabling other td's when one is clicked for edition... thanks in advance

<tbody>
    <g:each in="${labServices}" status="i" var="labServiceInstance">
        <tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
            <td>
                ${fieldValue(bean: labServiceInstance, field: "testUnit")}
            </td>

            <td id="${labServiceInstance.id}" >
               ${fieldValue(bean: labServiceInstance, field: "cost")}
             </td>
        </tr>
    </g:each>
</tbody>

来源:https://stackoverflow.com/questions/18909673/javascript-for-enable-and-dissable-td-in-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!