last day (14 days later) » 

2:43 AM
0
Q: jQuery keep other boxes not edited state

Jess McKenzieIn the code below when I click edit the other boxes loose the edited icon until cancel is clicked. Is there away that I can have it so that if a box is not being edited it keeps the normal state of code? Normal State: When an edit button is clicked: jQuery: /* X-Editable */ $(function()...

 
Can you provide the full javascript code
 
@KiranMuralee Done :)
 
I dont find problem in the $('.edit').click(function(e).Can you please provide the full html and js code so that I could start checking on it or start a fiddle
 
@KiranMuralee That is the full html - however the full js is gist.github.com/anonymous/34677e7621c994487b253da12c65742c
 
Can you pleaseremove line container.find('.updateField').editable('toggle') from $('.edit').click(function(e) and check.
Are you getting the correct inputName value
Also check if you are getting any error on clicking the edit button.
 
2:43 AM
@KiranMuralee inputName is correct :). removing the toggle removes the buttons once clicked
 
hii
container.find('.updateField').editable('toggle'); is it using library vitalets.github.io/x-editable/index.html
I have tried with the code you provided seems ok with limited code.I have tried only $('.edit').click(function(e)
 
yup x-exit
I have a feeling its to do when a button is clicked it changes the html for the buttons hence I loose formatting
 
ok if I cant get full html css and js nothing I could do
 
I have given the full html and js
 
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-1.12.3.min.js" integrity="sha256-aaODHAgvwQW1bFOGXMeX+pC4PZIPsvn2h1sArYOhgXQ=" crossorigin="anonymous"></script>

<script src="chttps://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<script>
$(function(){

alert("pii");
$('.edit').click(function(e){
var container = $(this).closest('.input-group'); // !!
I tried the above code and its seems working as expected
No I think you are using plugins and you didnt provide that
$('.edit').click(function(e){
var container = $(this).closest('.input-group'); // !!
var input = container.find('.updateField');
var inputName = input.attr('name');
var dataURL = input.data('url');

console.log(inputName);
e.stopPropagation();
container.find('.edit').hide(); // !!
});
Did you really check with this code.The code should hide only one button
Friend without having the full css,js and html,I am unable to find a sol;ution.You have said you provided full html,I see only limited html.
 
 
3 hours later…
6:19 AM
As I am not able to reproduce the issue that you have and neither any developers are able to solve your issue I suspect some other code is working in parallel is causing the issue.I will advise you to first find out when the change is happening ie when you could see all the edit buttons disappearing .For that I advise you to try the following code and watch the browser view at each alert.
$('.edit').click(function(e){
alert("inside edit button clicked");
var container = $(this).closest('.input-group'); // !!
var input = container.find('.updateField');
var inputName = input.attr('name');
var dataURL = input.data('url');

alert("input name="+inputName);
e.stopPropagation();
// container.find('.updateField').editable('toggle'); // !!
alert("before edit button hide on element");
container.find('.edit').hide(); // !!
alert("after edit button hide on element");
});
Check on the browser at each alert.I think finding out the cause will be the key for your problem
 
6:40 AM
Please answer to the question if you solved the issue.
 

last day (14 days later) »