我正在尝试访问传单弹出窗口中的内容。具体来说,我添加了一个带有我想要访问的按钮的表单。但现在我只是尝试向弹出窗口本身添加一个事件。
$(".leaflet-popup-content-wrapper .leaflet-popup-content").click(function(e) {
alert("clicked");
});
Run Code Online (Sandbox Code Playgroud)
LeafletJs带有弹出窗口的标记示例:
<form class="popup-form">
<div class="form-group">
<label class="mb-0" for="comment">Comment:</label>
<textarea class="form-control" rows="4" class="comment">${feature.properties.note}</textarea>
</div>
<div class="d-flex">
<button type="submit" class="btn btn-outline-info btn-sm">Save</button>
<button class="delete-button btn btn-outline-danger btn-sm ml-auto">Delete</button>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
设置弹出内容的代码
var points = new L.geoJson(null, {
onEachFeature: function (feature, layer) {
layer.bindPopup(feature.properties.note);
let myPopup = L.DomUtil.create('div', 'content');
content = `
<form class="popup-form">
<div class="form-group">
<label class="mb-0" for="comment">Comment:</label>
<textarea class="form-control" rows="4" class="comment">${feature.properties.id}</textarea>
</div>
<div class="d-flex">
<button type="submit" class="btn btn-outline-info btn-sm">Save</button>
<button class="delete-button btn btn-outline-danger btn-sm …Run Code Online (Sandbox Code Playgroud) 我对PostgreSQL很新,并且花了太多时间试图找到一个适应我想做的事情的例子.所以我希望我能在这里得到一些帮助
我有2张桌子,称他们为人和地址
我想创建一个触发器,当我在person_id = oid的第一个表中为person_id插入新值时,从表地址复制street和house_nr
表人
person_id
street
house_nr
other_attributes表地址
oid
street
house_nr
other_attributes
像这样的东西
INSERT INTO person
set person.street = address.street,
person.house_nr = address.house_nr
FROM address
WHERE person_id = oid
Run Code Online (Sandbox Code Playgroud)
希望有人有时间帮助欢呼
一段时间以来,我一直在尝试编写一个触发器函数,该函数在父表更改时更新子表中的行。我已经阅读了 Trigger procedure 文档,但我还没有真正掌握如何构建这些函数。
这是我尝试过但不起作用的方法...
CREATE FUNCTION myschema.update_child() RETURNS trigger AS
$BODY$
BEGIN
UPDATE myschema.child
set new.number = parent.number
FROM myschema.parent
WHERE id = "id";
RETURN NEW;
END
$BODY$
LANGUAGE plpgsql
Run Code Online (Sandbox Code Playgroud)
然后触发
CREATE TRIGGER update_child_after_update
AFTER INSERT OR UPDATE OR DELETE
ON myschema.child
FOR EACH ROW
EXECUTE PROCEDURE myschema.update_child();
Run Code Online (Sandbox Code Playgroud)
有没有人有一些提示?
此致