I generate one popup using window.open()a click of a button.
$.get(url).success(function(req) {
var win=window.open('popup.html', '', 'width=700, height=500, top=0, left(screen.width-700)');
win.document.write(req);
I have one editable field in a popup and it does not work. I'm trying something like this,
$.fn.editable.defaults.mode = 'popup';
for (var i=0; i<14; i++)
{
fieldname = "#sentiment_editable" + i
$(fieldname).editable({
inputclass: 'input-large',
source:[
{value:'positive', text: 'positive'},
{value:'neutral', text: 'neutral'},
{value:'negative', text: 'negative'}
]
});
}
win.document.close();
});
The field name (tag identifier) comes from the ajax (req) response. In popup.html, I have included the following libraries:
<script type="text/javascript" src="/js/jqueryui-editable.js"></script>
<link rel="stylesheet" type="text/css" href="/css/jqueryui-editable.css" />
The content of the request is as follows:
<script type="text/javascript" src="/js/jqueryui-editable.js"></script>
<link rel="stylesheet" type="text/css" href="/css/jqueryui-editable.css" />
<div id="chatterpage" class="contentArea">
<div id="allsocial" >
<div id="all_container">
<div id="eachchatter1" class="socialcontentdiv" onmouseover="document.getElementById('chatterbuttons1').style.display='block'" onmouseout="document.getElementById('chatterbuttons1').style.display='none'">
<table border=0 width=100%>
<tr>
<td width=60%>
<span class="socialcontent1bold">Mood: </span>
<span class="socialcontent1">
<a data-original-title="Select sentiment" data-pk="1" data-url="/Handler" data-params='{chatterid: "5625665ba40e3cbef58de56a758d373d"}' data-type="select" data-value="neutral" id="sentiment_editable1" style="cursor:pointer" >neutral</a>
</span></td></tr>
<tr>
<td width=60%>
<span class="socialcontent1bold">Mood: </span>
<span class="socialcontent1">
<a data-original-title="Select sentiment" data-pk="1" data-url="/Handler" data-params='{chatterid: "fff3878b2d0e6849e9ee8408e7999892"}' data-type="select" data-value="neutral" id="sentiment_editable2" style="cursor:pointer" >neutral</a>
</span></td></tr>
</table>
</div><br/>
</div>
</div>
</div>
Please help me.
source
share